Network port detection method and device and storage system

By generating loopback detection packets in the internal processor of the storage system, the problem of network port detection affecting storage services in the prior art is solved, and network port detection without external packetizer is realized, ensuring service continuity.

CN119728473APending Publication Date: 2025-03-28CHENGDU HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311287794.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, when detecting the status of the network port of the storage system, an external packetizer is required, which causes the network port to be unable to be used normally, which may affect the storage service.

Method used

The processor inside the storage system generates a loopback detection message and sends the message to the network port. The network port processes the message and returns a response. The processor determines the fault condition of the network port based on the response.

Benefits of technology

It realizes the detection of network port status without an external packetizer, ensuring that the network port can still perform services normally during the detection process without affecting storage services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728473A_ABST
    Figure CN119728473A_ABST
Patent Text Reader

Abstract

The invention provides a network port detection method and device and a storage system, the method is applied to a processor in the storage system, and the method comprises the following steps: generating a loopback detection message, the loopback detection message carries first storage position indication information of the data in an original storage domain and second storage position indication information of the data in a target storage domain, and the first storage position indication information is used for indicating the network port to read the data in the original storage domain; the second storage position indication information is used for indicating the network port to store the data to the destination storage domain. And sending the loopback detection message to the network port. And receiving a response to the loopback detection message sent by the network port, the response being generated after the network port processes the loopback detection message. And determining whether the network port fails according to the response. The method can be realized without an external packet sender, and the storage service is not influenced in the detection process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of cloud technology, and in particular to a method, device and storage system for network port detection. Background Art

[0002] Storage systems are usually composed of memory, processors, and network ports. Network ports are used for communication between the storage system and external devices. If the network port fails, the external device cannot read or write data to the storage system.

[0003] In order to determine the status of the network port, in the related art, an external packet sender is connected to the network port, and the packet sender sends a detection message to the network port. The chip inside the network port processes the message and returns a response to the external packet sender. The external packet sender determines whether the network port is faulty based on the response returned by the network port.

[0004] In the above network port detection method, an external packet transmitter is required. During the period of the external packet transmitter, the network port cannot be used normally. If the above method is used to perform network port detection during the normal operation of the storage system, it may have a certain impact on the storage business. Summary of the invention

[0005] The present disclosure provides a method, device and storage system for network port detection, which can perform network port detection without an external packet sender. During the detection period, the network port can still perform services normally without affecting the storage service. The technical solution is as follows:

[0006] In a first aspect, a method for detecting a network port is provided. The method is applied to a processor in a storage system. The storage system also includes a network port. The method includes:

[0007] Generate a loopback detection message, wherein the loopback detection message carries first storage location indication information of the data in the original storage domain and second storage location indication information of the data in the destination storage domain, the first storage location indication information is used to instruct the network port to read the data in the original storage domain, and the second storage location indication information is used to instruct the network port to store the data in the destination storage domain, and send a loopback detection message to the network port. Receive a response to the loopback detection message sent by the network port, wherein the response is generated after the network port processes the loopback detection message. Determine whether the network port is faulty based on the response.

[0008] In the technical solution provided by the present disclosure, a loopback detection message is generated by a processor inside the storage system, and the loopback detection message is sent to the network port. The loopback detection message is a read and write command for data, which is closer to a real business scenario. The network port processes the loopback detection message and returns a response to the processor. The processor determines the fault condition of the network port based on the response. It can be seen that in the method for network port detection provided by the embodiment of the present disclosure, an external packet sender is not required. During the execution of the network port detection process, the network port executes the storage business normally and will not affect the storage business being executed. In this way, the network port detection is more flexible and can be executed at any time according to demand without interrupting the business of the network port.

[0009] In a possible implementation, the storage system includes a memory, and the original storage domain and the destination storage domain belong to the memory.

[0010] In the technical solution provided by the present disclosure, two storage areas are reserved in the memory for storing data used for network port detection. In order to be closer to the real scene, the data used here can be real network data.

[0011] In a possible implementation, in order to simulate a real storage service scenario, a loopback detection message may be sent to the network port through a first submission queue (SQ) between the network port and the network port.

[0012] In one possible implementation, in order to not affect the performance of existing storage services when sending loopback detection messages, the priority of the first SQ used to send loopback detection messages can be configured to be lower than the priority of the second SQ between the network port, where the second SQ is the SQ used to send service messages.

[0013] In one possible implementation, after the loopback detection message enters the network port, it first reaches the MAC layer of the sending end in the network port. Accordingly, the MAC layer of the sending end processes the loopback detection message. If the processing fails, a response is returned to the processor, wherein the response carries the first fault cause indication information and the first fault location indication information.

[0014] After receiving the response, the processor obtains the first fault cause indication information and the first fault location indication information carried in the response, and determines that a first fault occurs in the MAC layer of the transmitting end according to the first fault cause indication information and the first fault location indication information. The first fault may be a MAC header encapsulation failure.

[0015] In one possible implementation, if the MAC layer of the sending end successfully processes the loopback detection message, it sends the processed loopback detection message to the PHY layer of the sending end. The PHY layer of the sending end processes the loopback detection message. If the processing fails, it returns a response to the processor, wherein the response carries the second fault cause indication information and the second fault location indication information.

[0016] After receiving the response, the processor obtains the second fault cause indication information and the second fault location indication information carried in the response. According to the second fault cause indication information and the second fault location indication information, it is determined that a second fault occurs in the PHY layer of the transmitting end. The second fault may be a failure to add verification information.

[0017] In one possible implementation, if the PHY layer of the sending end successfully processes the loopback detection message, the processed loopback detection message is sent to the PHY layer of the receiving end. The PHY layer of the receiving end processes the loopback detection message. If the processing fails, a response is returned to the processor, wherein the response carries third fault cause indication information and third fault location indication information.

[0018] After receiving the response, the processor obtains the third fault cause indication information and the third fault location indication information carried in the response. According to the third fault cause indication information and the third fault location indication information, it is determined that a third fault occurs at the PHY layer of the receiving end. The third fault may be a check failure, specifically, a CRC check failure.

[0019] In one possible implementation, if the PHY layer of the receiving end successfully processes the loopback detection message, it sends the processed loopback detection message to the MAC layer of the receiving end, and the MAC layer of the receiving end processes the loopback detection message and performs data read and write processing indicated by the loopback detection message. If the processing fails, a response is returned to the processor, wherein the response carries fourth fault cause indication information and fourth fault location indication information.

[0020] After receiving the response, the processor obtains the fourth fault cause indication information and the fourth fault location indication information carried in the response. According to the fourth fault cause indication information and the fourth fault location indication information, it is determined that a fourth fault occurs at the MAC layer of the receiving end. The fourth fault may be a data read or write failure.

[0021] In a second aspect, a device for detecting a network port is provided, the device being applied to a processor in a storage system, the storage system further comprising a network port, the device comprising:

[0022] A generating module, used for generating a loopback detection message, wherein the loopback detection message carries first storage location indication information of the data in the original storage domain and second storage location indication information of the data in the destination storage space, the first storage location indication information is used for instructing the network port to read the data in the original storage domain, and the second storage location indication information is used for instructing the network port to store the data in the destination storage domain;

[0023] A sending module, used for sending the loopback detection message to the network port;

[0024] A receiving module, configured to receive a response to the loopback detection message sent by the network port, wherein the response is generated after the network port processes the loopback detection message;

[0025] The processing module is used to determine whether the network port is faulty according to the response.

[0026] In a possible implementation manner, the storage system includes a memory, and the original storage domain and the destination storage domain belong to the memory.

[0027] In a possible implementation, the sending module is used to:

[0028] The loopback detection message is sent to the network port through a first submission queue SQ between the network port and the network port.

[0029] In a possible implementation manner, the priority of the first SQ is lower than the priority of a second SQ between the first SQ and the network port, wherein the second SQ is an SQ used to send service packets.

[0030] In a possible implementation, the receiving module is used to:

[0031] Receiving a response to the loopback detection message sent by a media access control MAC layer of a sending end of the network port, wherein the response carries first fault cause indication information and first fault location indication information;

[0032] The processing module is used for:

[0033] Acquire the first fault cause indication information and the first fault location indication information;

[0034] According to the first fault cause indication information and the first fault location indication information, it is determined that a first fault occurs at the MAC layer of the transmitting end.

[0035] In a possible implementation, the receiving module is used to:

[0036] Receiving a response to the loopback detection message sent by the physical PHY layer of the transmitting end of the network port, wherein the response carries second fault cause indication information and second fault location indication information;

[0037] The processing module is used for:

[0038] Acquire the second fault cause indication information and the second fault location indication information;

[0039] According to the second fault cause indication information and the second fault location indication information, it is determined that a second fault occurs at the PHY layer of the transmitting end.

[0040] In a possible implementation, the receiving module is used to:

[0041] Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries third fault cause indication information and third fault location indication information;

[0042] The processing module is used for:

[0043] Acquire the third fault cause indication information and the third fault location indication information;

[0044] According to the third fault cause indication information and the third fault location indication information, it is determined that a third fault occurs at the PHY layer of the receiving end.

[0045] In a possible implementation, the receiving module is used to:

[0046] Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries fourth fault cause indication information and fourth fault location indication information;

[0047] The processing module is used for:

[0048] Acquire the fourth fault cause indication information and the fourth fault location indication information;

[0049] According to the fourth fault cause indication information and the fourth fault location indication information, it is determined that a fourth fault occurs at the MAC layer of the receiving end.

[0050] In a third aspect, a storage system is provided, the storage system comprising a processor and a network port, the processor being configured to execute the network port detection method as described in the first aspect above.

[0051] In a fourth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a storage system, the storage system executes the network port detection method as described in the first aspect above.

[0052] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a storage system, the storage system executes the method for network port detection as described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 is a structural diagram of a storage system provided by an embodiment of the present disclosure;

[0054] Figure 2 is a structural diagram of a storage system provided by an embodiment of the present disclosure;

[0055] Figure 3 is a flow chart of a method for network port detection provided by an embodiment of the present disclosure;

[0056] Figure 4 It is a schematic diagram of the structure of a device for network port detection provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0057] The present disclosure provides a method for detecting a network port, which can be applied to a storage system. Figure 1As shown, the storage system may include a memory 101, a processor 102, and a network port 103. Among them, the memory 101 may include a memory, a disk, a hard disk, etc. The memory refers to an internal memory that directly exchanges data with the processor 101, and it can read and write data at any time. The memory may be a random access memory, and the random access memory is a dynamic random access memory (DRAM) or a storage class memory (SCM). DRAM is a semiconductor memory, and like most random access memories (RAM), it is a volatile memory device. SCM is a composite storage technology that combines the characteristics of traditional storage devices and memories. Storage class memory can provide faster read and write speeds than hard disks, but the access speed is slower than DRAM, and the cost is cheaper than DRAM. However, DRAM and SCM are only exemplary descriptions in the embodiments of the present disclosure, and the memory may also include other random access memories, such as static random access memories (SRAM). In addition, the memory can also be a dual in-line memory module or a dual-line memory module (Dual In-line Memory Module, DIMM), that is, a module composed of a dynamic random access memory (DRAM), or a solid state disk (SSD). Disks and hard disks can be used to persistently store business data. The processor 102 can be implemented in at least one hardware form of an application-specific integrated circuit (ASIC), a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). Of course, the processor can also have other hardware implementations, which are not limited in the embodiments of the present disclosure. The network port 103 may include a communication chip for communicating with an external device to provide storage services. The communication chip includes a transmitting end and a receiving end, the transmitting end includes a medium access control (MAC) layer of the transmitting end and a physical (PHY) layer of the transmitting end, and the receiving end includes a MAC layer of the receiving end and a PHY layer of the receiving end.

[0058] In the method for network port detection provided in the embodiment of the present disclosure, a loopback detection message is generated by a processor inside the storage system, and the loopback detection message is sent to the network port. The loopback detection message is a read and write command for data, which is closer to a real business scenario. The network port processes the loopback detection message and returns a response to the processor. The processor determines the fault condition of the network port based on the response. It can be seen that in the method for network port detection provided in the embodiment of the present disclosure, there is no need for an external packet sender. During the execution of the network port detection process, the network port executes the storage business normally and will not affect the storage business being executed. In this way, network port detection is more flexible and can be executed at any time according to demand without interrupting the business of the network port.

[0059] See also Figure 2 The network port detection method provided by the embodiment of the present disclosure can be implemented by software running on a processor. According to the functions implemented by the software in the method, the software can be divided into a loopback detection module, a fault handling module, and a port driver. In addition, in order to simulate real storage services during network port detection, two storage domains can be reserved in the memory, such as Figure 2 The first storage domain and the second storage domain in the communication chip are used to store data used for network port detection. In order to be closer to the real scene, the data used here can be real network data. In addition, a message conversion module can also be run on the communication chip, and the message conversion module is used to forward the loopback detection message sent by the PHY layer of the transmitting end of the communication chip to the PHY layer of the receiving end of the communication chip.

[0060] The following is a description of the network port detection method provided by the embodiment of the present disclosure in conjunction with the accompanying drawings. Figure 3 , the processing flow of the method may include the following steps:

[0061] Step 301: The loopback detection module generates a loopback detection message.

[0062] The loopback detection message carries a port detection identifier, a first storage location indication information of the data in the original storage domain, and a second storage location indication information of the data in the destination storage domain. The first storage location indication information may be a Scatter Gather List (SGL) page of the original storage domain, and the second storage location indication information may be an SGL page of the destination storage domain. The original storage domain may be Figure 2 The first storage domain in the target storage domain can be Figure 2 The second storage domain in.

[0063] In implementation, when a port detection trigger event occurs, the loopback detection module generates a loopback detection message. There can be many types of port detection trigger events, and several of them are listed below for illustration:

[0064] Port detection trigger event 1: receiving port detection command.

[0065] When the user wants to detect the network port, the user can input a port detection instruction to the storage system. When the loopback detection module receives the port detection instruction, it determines that a port detection trigger event occurs.

[0066] Port detection trigger event 2: reaching the port detection cycle.

[0067] The port detection period may be preconfigured, and illustratively, the port detection period may be 1 hour, 2 hours, etc. When the loopback detection module determines that the port detection period has been reached, it determines that a port detection triggering event has occurred.

[0068] Step 302: The loopback detection module sends a loopback detection message to the port driver.

[0069] In implementation, after generating the loopback detection message, the loopback detection module sends the loopback detection message to the port driver.

[0070] Step 303: The port driver sends a loopback detection message to the MAC layer of the sending end of the network port.

[0071] In implementation, upon receiving the loopback detection message, the port driver sends the loopback detection message to the MAC layer of the transmitting end.

[0072] Specifically, the port driver may send a loopback detection message to the MAC layer of the transmitting end of the network port through a first submission queue (SQ) between the port driver and the network port.

[0073] In a possible implementation, in order not to affect the performance of the running service, the priority of the first SQ may be configured to be lower than the priority of other SQs, where the other SQs are SQs used to submit service messages.

[0074] Step 304: When the port driver sends a loopback detection message to the MAC layer of the transmitting end, if the sending fails, the port driver sends a first response to the fault processing module.

[0075] In implementation, when the port driver sends a loopback detection message to the first SQ, if the sending fails and it is determined that the loopback detection message carries a port detection identifier, a first response is sent to the fault processing module. The first response carries first fault cause indication information and first fault location indication information. The first fault cause indication information is used to indicate that the sending of the loopback detection message to the first SQ fails, and the first fault location indication information is used to indicate that the fault location is the port driver.

[0076] Step 305: The MAC layer at the sending end processes the received loopback detection message.

[0077] In implementation, the MAC layer of the transmitting end receives the loopback detection message sent by the port driver through the first SQ, and then encapsulates the loopback detection message with a MAC header. The MAC header may include the original MAC address, the destination MAC address, the transmission protocol type, etc.

[0078] Here, when encapsulating the MAC header, the MAC layer of the sending end determines that the loopback detection message carries a port detection identifier, and then writes both the original MAC address and the destination MAC address as the local MAC address.

[0079] Step 306: If the MAC layer of the transmitting end processes the received loopback detection message successfully, it sends the processed loopback detection message to the PHY layer of the transmitting end.

[0080] In implementation, the MAC layer of the sending end may successfully encapsulate the loopback detection message, and then send the processed loopback detection message to the PHY layer of the sending end.

[0081] Step 307: If the MAC layer of the sending end fails to process the received loopback detection message, it sends a second response to the fault processing module.

[0082] In implementation, if the MAC layer of the transmitting end fails to encapsulate the received loopback detection message and determines that the loopback detection message carries a port detection identifier, the loopback detection message is not sent to the PHY layer of the transmitting end, but a second response is sent to the fault processing module. The second response carries second fault cause indication information and second fault location indication information. The second fault cause indication information is used to indicate that the MAC header encapsulation failed, and the first fault location indication information is used to indicate that the fault location is the MAC layer of the transmitting end.

[0083] In a possible implementation, the MAC layer of the sending end may send the second response to the fault processing module through a completion queue (CompletionQueue, CQ).

[0084] Step 308: The PHY layer at the transmitting end processes the received loopback detection message processed by the MAC layer.

[0085] In implementation, after receiving the loopback detection message sent by the MAC layer of the transmitting end, the PHY layer of the transmitting end adds verification information to the loopback detection message encapsulated by the MAC layer, wherein the verification information may be a cyclic redundancy check code.

[0086] Step 309: If the PHY layer of the transmitting end successfully processes the received loopback detection message processed by the MAC layer of the transmitting end, the PHY layer sends the processed loopback detection message to the message conversion module.

[0087] In implementation, if the PHY layer of the transmitting end successfully adds verification information to the received loopback detection message processed by the MAC layer of the transmitting end, the loopback detection message processed by the PHY layer of the transmitting end is sent to the message conversion module.

[0088] Step 310: If the PHY layer of the transmitting end fails to process the loopback detection message received after being processed by the MAC layer of the transmitting end, the PHY layer of the transmitting end sends a third response to the fault processing module.

[0089] In implementation, if the PHY layer of the transmitting end fails to add verification information to the loopback detection message received after being processed by the MAC layer of the transmitting end, and determines that the loopback detection message carries a port detection identifier, the loopback detection message is no longer sent to the message conversion module, and a third response is sent to the fault processing module. The third response carries third fault cause indication information and third fault location indication information. The third fault cause indication information is used to indicate that the verification information addition failed, and the first fault location indication information is used to indicate that the fault location is the PHY layer of the transmitting end.

[0090] In a possible implementation, the PHY layer of the transmitting end may send the third response to the fault processing module through the CQ queue.

[0091] Step 311: The message conversion module sends the loopback detection message received and processed by the PHY layer of the transmitting end to the PHY layer of the receiving end.

[0092] In implementation, after receiving the loopback detection message processed by the PHY layer of the sending end, the message conversion module forwards the loopback detection message to the PHY layer of the sending end.

[0093] Step 312: The PHY layer at the receiving end processes the received loopback detection message.

[0094] In implementation, after receiving the loopback detection message sent by the message conversion module, the PHY layer of the receiving end verifies the loopback detection message according to the verification information carried in the loopback detection message. Exemplarily, if the verification information is a CRC code, the PHY layer of the receiving end performs a CRC check on the loopback detection message according to the CRC code.

[0095] Step 313: If the PHY layer at the receiving end processes the received loopback detection message successfully, the PHY layer at the receiving end sends the processed loopback detection message to the MAC layer at the receiving end.

[0096] In implementation, if the PHY layer at the receiving end successfully verifies the loopback detection message sent by the message conversion module, it sends the processed loopback detection message to the MAC layer at the receiving end.

[0097] Step 314: If the PHY layer at the receiving end fails to process the received loopback detection message, it sends a fourth response to the fault processing module.

[0098] In implementation, if the PHY layer of the receiving end fails to verify the loopback detection message sent by the message conversion module and determines that the loopback detection message carries a port detection identifier, the processed loopback detection message is not sent to the MAC of the receiving end, and a fourth response is sent to the fault processing module. The fourth response carries fourth fault cause indication information and fourth fault location indication information. The fourth fault cause indication information is used to indicate a verification failure, and the fourth fault location indication information is used to indicate that the fault location is the PHY layer of the receiving end.

[0099] In a possible implementation, the PHY layer of the receiving end may send the fourth response to the fault processing module through the CQ queue.

[0100] Step 315: The MAC layer at the receiving end processes the loopback detection message processed by the PHY layer at the receiving end.

[0101] In the implementation, the MAC layer of the receiving end removes the MAC header of the loopback detection message received after being processed by the PHY layer of the receiving end, and performs the data reading operation indicated by the loopback detection message. Specifically, data can be read in the original storage domain according to the first storage location indication information carried in the loopback detection message, and the read data can be written into the second storage domain according to the second storage location indication information.

[0102] In the case where the first storage location indication information is the SGL page of the original storage domain and the second storage location information is the SGL page of the destination storage domain, the MAC layer of the receiving end reads data in the original storage domain according to the SGL page of the original storage domain, and writes the read data to the destination storage domain according to the SGL page of the destination storage domain. The specific read and write operations are the same as those when performing actual storage services, and will not be repeated here.

[0103] Step 316: If the MAC layer at the receiving end successfully processes the loopback detection message processed by the PHY layer at the receiving end, the MAC layer at the receiving end sends a sixth response to the loopback detection module.

[0104] In implementation, if the MAC layer of the receiving end executes the data read / write operation successfully, it sends a sixth response to the loopback detection module. The sixth response is used to indicate that the data read / write is successful.

[0105] Step 317: If the MAC layer at the receiving end successfully processes the loopback detection message processed by the PHY layer at the receiving end, it sends a fifth response to the fault processing module.

[0106] In implementation, if the MAC layer of the receiving end fails to perform a data read / write operation and determines that the loopback detection message carries a port detection identifier, a fifth response is sent to the fault processing module. The fifth response carries fifth fault cause indication information and fifth fault location indication information. The fifth fault cause indication information is used to indicate that the data read / write operation failed, and the fifth fault location indication information is used to indicate that the fault location is the MAC layer of the receiving end.

[0107] In a possible implementation, the PHY layer of the receiving end may send the fifth response to the fault processing module through the CQ queue.

[0108] Step 318: The fault processing module determines the fault condition of the network port according to the received response.

[0109] In implementation, the fault processing module may store the correspondence between the fault cause indication information and the processing strategy, and may determine the corresponding processing strategy according to the fault cause indication information carried in the response.

[0110] Exemplarily, for the above-mentioned first fault cause indication information, the processing strategy may be to restart the network port. For a fault inside the communication chip, such as the second fault cause indication information, the third fault cause indication information, the fourth fault cause indication information, and the fifth fault cause indication information, the network port may be reset, or the network port may be shielded, and a network port fault alarm may be issued.

[0111] The network port fault alarm may be in the form of a prompt tone, short message, email, indicator light, display text pop-up window, etc., which is not limited in the embodiments of the present disclosure.

[0112] In a possible implementation, the loopback detection module can count the number of loopback detection timeouts. If it is determined that the number of loopback detection timeouts reaches a timeout threshold, the sixth fault cause indication information is sent to the fault processing module, and the sixth fault cause indication information is used to indicate that the loopback detection timed out. The timeout threshold may be 3 times, 5 times, etc. For the sixth fault cause indication information, since the specific fault cause is uncertain, the processing strategy may be to shield the network port and issue a network port fault alarm.

[0113] The above loop detection timeout refers to the time taken from the loop detection module sending the loop detection message to the loop detection module or the fault handling module receiving the response, which exceeds the preset time. Exemplarily, the preset time may be 1 second, 2 seconds, etc.

[0114] In addition, the above-mentioned loopback detection module, fault handling module and port driver are only an example of functional division of the software running on the processor. The software running on the processor can also be divided into more or fewer software modules to execute the above-mentioned network port detection method. For example, the above-mentioned loopback detection module, fault handling module and port driver are used as a software module without functional division. In the above-mentioned process, the processing of the loopback detection module, fault handling module and port driver is implemented by the software module. In this way, the interaction between the above-mentioned loopback detection module, fault handling module and port driver does not need to be executed. For another example, the above-mentioned loopback detection module and fault handling module are divided into one software module. In the above-mentioned process, the processing of the above-mentioned loopback detection module and fault handling module is implemented by the software module. In this way, the interaction between the above-mentioned loopback detection module and fault handling module does not need to be executed.

[0115] The embodiment of the present disclosure also provides a device for detecting a network port, such as Figure 4 As shown, the device can be applied to a storage system, and the device includes: a generating module 410, a sending module 420, a receiving module 430 and a processing module 440, wherein:

[0116] A generating module 410 is used to generate a loopback detection message, wherein the loopback detection message carries first storage location indication information of the data in the original storage domain and second storage location indication information of the data in the destination storage space, wherein the first storage location indication information is used to instruct the network port to read the data in the original storage domain, and the second storage location indication information is used to instruct the network port to store the data in the destination storage domain;

[0117] A sending module 420, configured to send the loopback detection message to the network port;

[0118] A receiving module 430, configured to receive a response to the loopback detection message sent by the network port, wherein the response is generated after the network port processes the loopback detection message;

[0119] The processing module 440 is used to determine whether the network port is faulty according to the response.

[0120] In a possible implementation manner, the storage system includes a memory, and the original storage domain and the destination storage domain belong to the memory.

[0121] In a possible implementation, the sending module 420 is configured to:

[0122] The loopback detection message is sent to the network port through a first submission queue SQ between the network port and the network port.

[0123] In a possible implementation manner, the priority of the first SQ is lower than the priority of a second SQ between the first SQ and the network port, wherein the second SQ is an SQ used to send service packets.

[0124] In a possible implementation, the receiving module 430 is configured to:

[0125] Receiving a response to the loopback detection message sent by a media access control MAC layer of a sending end of the network port, wherein the response carries first fault cause indication information and first fault location indication information;

[0126] The processing module 440 is used to:

[0127] Obtaining the first fault cause indication information and the first fault location indication information;

[0128] According to the first fault cause indication information and the first fault location indication information, it is determined that a first fault occurs at the MAC layer of the transmitting end.

[0129] In a possible implementation, the receiving module 430 is configured to:

[0130] Receiving a response to the loopback detection message sent by the physical PHY layer of the transmitting end of the network port, wherein the response carries second fault cause indication information and second fault location indication information;

[0131] The processing module 440 is used to:

[0132] Acquire the second fault cause indication information and the second fault location indication information;

[0133] According to the second fault cause indication information and the second fault location indication information, it is determined that a second fault occurs at the PHY layer of the transmitting end.

[0134] In a possible implementation, the receiving module 430 is configured to:

[0135] Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries third fault cause indication information and third fault location indication information;

[0136] The processing module 440 is used to:

[0137] Acquire the third fault cause indication information and the third fault location indication information;

[0138] According to the third fault cause indication information and the third fault location indication information, it is determined that a third fault occurs at the PHY layer of the receiving end.

[0139] In a possible implementation, the receiving module 430 is configured to:

[0140] Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries fourth fault cause indication information and fourth fault location indication information;

[0141] The processing module 440 is used to:

[0142] Acquire the fourth fault cause indication information and the fourth fault location indication information;

[0143] According to the fourth fault cause indication information and the fourth fault location indication information, it is determined that a fourth fault occurs at the MAC layer of the receiving end.

[0144] It should be noted that: the network port detection device provided in the above embodiment only uses the division of the above functional modules as an example when detecting the network port. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the storage system is divided into different functional modules to complete all or part of the functions described above. In addition, the network port detection device provided in the above embodiment and the network port detection method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0145] The embodiment of the present disclosure also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a storage system or stored in any available medium. When the computer program product is run on a storage system, the storage system is caused to perform a method for detecting a network port.

[0146] The embodiment of the present disclosure also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the storage system to perform a method for detecting a network port.

[0147] Those of ordinary skill in the art will appreciate that the various method steps and units described in the embodiments disclosed in this disclosure can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.

[0148] The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure 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 protection scope of the technical solutions of the embodiments of the present disclosure.

[0149] It should be noted that the data involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the data used to detect network ports and network data involved in this disclosure are all obtained with full authorization.

Claims

1. A method for network port detection, characterized in that: The method is applied to a processor in a storage system, the storage system further comprising a network port, and the method comprises: Generate a loopback detection message, wherein the loopback detection message carries first storage location indication information of the data in the original storage domain and second storage location indication information of the data in the destination storage domain, the first storage location indication information is used to instruct the network port to read the data in the original storage domain, and the second storage location indication information is used to instruct the network port to store the data in the destination storage domain; Sending the loopback detection message to the network port; Receiving a response to the loopback detection message sent by the network port, wherein the response is generated after the network port processes the loopback detection message; According to the response, it is determined whether the network port fails.

2. The method according to claim 1, characterized in that The storage system includes a memory, and the original storage domain and the destination storage domain belong to the memory.

3. The method according to claim 1 or 2, characterized in that: The sending the loopback detection message to the network port includes: The loopback detection message is sent to the network port through a first submission queue SQ between the network port and the network port.

4. The method according to claim 3, characterized in that The priority of the first SQ is lower than the priority of the second SQ between the first SQ and the network port, wherein the second SQ is an SQ used to send service messages.

5. The method according to any one of claims 1 to 4, characterized in that The receiving a response to the loopback detection message sent by the network port includes: Receiving a response to the loopback detection message sent by a media access control MAC layer of a sending end of the network port, wherein the response carries first fault cause indication information and first fault location indication information; Determining whether the network port is faulty according to the response includes: Obtaining the first fault cause indication information and the first fault location indication information; According to the first fault cause indication information and the first fault location indication information, it is determined that a first fault occurs at the MAC layer of the transmitting end.

6. The method according to any one of claims 1 to 4, characterized in that The receiving a response to the loopback detection message sent by the network port includes: Receiving a response to the loopback detection message sent by the physical PHY layer of the transmitting end of the network port, wherein the response carries second fault cause indication information and second fault location indication information; Determining whether the network port is faulty according to the response includes: Acquire the second fault cause indication information and the second fault location indication information; According to the second fault cause indication information and the second fault location indication information, it is determined that a second fault occurs at the PHY layer of the transmitting end.

7. The method according to any one of claims 1 to 4, characterized in that The receiving a response to the loopback detection message sent by the network port includes: Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries third fault cause indication information and third fault location indication information; Determining whether the network port is faulty according to the response includes: Acquire the third fault cause indication information and the third fault location indication information; According to the third fault cause indication information and the third fault location indication information, it is determined that a third fault occurs at the PHY layer of the receiving end.

8. The method according to any one of claims 1 to 4, characterized in that The receiving a response to the loopback detection message sent by the network port includes: Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries fourth fault cause indication information and fourth fault location indication information; Determining whether the network port is faulty according to the response includes: Acquire the fourth fault cause indication information and the fourth fault location indication information; According to the fourth fault cause indication information and the fourth fault location indication information, it is determined that a fourth fault occurs at the MAC layer of the receiving end.

9. A network port detection device, characterized in that: The device is applied to a processor in a storage system, the storage system further includes a network port, and the device includes: A generating module, used for generating a loopback detection message, wherein the loopback detection message carries first storage location indication information of the data in the original storage domain and second storage location indication information of the data in the destination storage space, the first storage location indication information is used for instructing the network port to read the data in the original storage domain, and the second storage location indication information is used for instructing the network port to store the data in the destination storage domain; A sending module, used for sending the loopback detection message to the network port; A receiving module, configured to receive a response to the loopback detection message sent by the network port, wherein the response is generated after the network port processes the loopback detection message; The processing module is used to determine whether the network port is faulty according to the response.

10. The device according to claim 9, characterized in that The storage system includes a memory, and the original storage domain and the destination storage domain belong to the memory.

11. The device according to claim 9 or 10, characterized in that The sending module is used for: The loopback detection message is sent to the network port through a first submission queue SQ between the network port and the network port.

12. The device according to claim 11, characterized in that The priority of the first SQ is lower than the priority of the second SQ between the first SQ and the network port, wherein the second SQ is an SQ used to send service messages.

13. The device according to any one of claims 9 to 12, characterized in that The receiving module is used for: Receiving a response to the loopback detection message sent by a media access control MAC layer of a sending end of the network port, wherein the response carries first fault cause indication information and first fault location indication information; The processing module is used for: Obtaining the first fault cause indication information and the first fault location indication information; According to the first fault cause indication information and the first fault location indication information, it is determined that a first fault occurs at the MAC layer of the transmitting end.

14. The device according to any one of claims 9 to 12, characterized in that The receiving module is used for: Receiving a response to the loopback detection message sent by the physical PHY layer of the transmitting end of the network port, wherein the response carries second fault cause indication information and second fault location indication information; The processing module is used for: Acquire the second fault cause indication information and the second fault location indication information; According to the second fault cause indication information and the second fault location indication information, it is determined that a second fault occurs at the PHY layer of the transmitting end.

15. The device according to any one of claims 9 to 12, characterized in that The receiving module is used for: Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries third fault cause indication information and third fault location indication information; The processing module is used for: Acquire the third fault cause indication information and the third fault location indication information; According to the third fault cause indication information and the third fault location indication information, it is determined that a third fault occurs at the PHY layer of the receiving end.

16. The device according to any one of claims 9 to 12, characterized in that The receiving module is used for: Receiving a response to the loopback detection message sent by a PHY layer of a receiving end of the network port, wherein the response carries fourth fault cause indication information and fourth fault location indication information; The processing module is used for: Acquire the fourth fault cause indication information and the fourth fault location indication information; According to the fourth fault cause indication information and the fourth fault location indication information, it is determined that a fourth fault occurs at the MAC layer of the receiving end.

17. A storage system, characterized in that: The storage system comprises a processor and a network port, and the processor is used to execute the network port detection method according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a storage system, the storage system executes the method for detecting a network port according to any one of claims 1 to 8.

19. A computer program product comprising instructions, characterized in that When the instruction is executed by the storage system, the storage system executes the network port detection method according to any one of claims 1 to 8.