Communication method and device based on MCTP
The method and device improve MCTP communication reliability in servers by enabling communication across multiple media, ensuring uninterrupted data transfer by switching to alternative media when needed.
Patent Information
- Application Number
- CN202411095994.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-27
AI Technical Summary
Current MCTP communication in servers is limited to PCIe media, leading to unreliable communication due to lack of redundancy across different communication media.
A method and device that enable MCTP communication through multiple media (PCIe, SMBus, I3C) by selecting a target communication medium based on priority and availability, ensuring reliable data transmission even if one medium is blocked.
Enhances communication reliability by allowing MCTP devices to switch to alternative media when one is unavailable, ensuring continuous data exchange.
Smart Images

Figure CN119211371A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a communication method and device based on MCTP (management component transport protocol). Background Art
[0002] MCTP is used for information exchange between components in a computer system. It is a protocol independent of physical media, that is, MCTP data packets can be transmitted based on different communication media, such as PCIe (peripheral component interconnect express, a high-speed serial computer expansion bus standard), SMBus (system management bus), I3C (improved inter-integrated circuit), etc.
[0003] In a server, a baseboard management controller (BMC) can be used to communicate with MCTP devices, which are components in the server, such as network cards, hard disks, and RAID (Redundant Arrays of Independent Disks) cards. However, currently, BMC can usually only communicate with MCTP devices based on PCIe media, and the reliability of communication cannot be guaranteed. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a communication method and device based on MCTP, which is used to improve the reliability of MCTP communication.
[0005] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:
[0006] In a first aspect, an embodiment of the present application provides a communication method based on a management component transport protocol MCTP, the method comprising:
[0007] Generate a data transmission request, the data transmission request including payload data, multiple endpoint identifiers of a target MCTP device, and a communication medium corresponding to the endpoint identifier;
[0008] Selecting a target communication medium from the communication media corresponding to the endpoint identifier;
[0009] Generate an MCTP data packet corresponding to the target communication medium according to the data sending request;
[0010] The MCTP data packet is sent to the target MCTP device through a communication interface corresponding to the target communication medium.
[0011] When the embodiment of the present application needs to communicate with the MCTP device, a data transmission request is first generated, and the data transmission request includes payload data, multiple endpoint identifiers of the target MCTP device, and the communication medium corresponding to each endpoint identifier. Then, the target communication medium can be selected from the communication medium corresponding to the endpoint identifier, and the MCTP data packet of the target communication medium is generated. Finally, the MCTP data packet is sent to the target MCTP device through the communication interface corresponding to the target communication medium. Thus, MCTP communication can be achieved through any one of the multiple communication media supported by the target MCTP device. When one communication medium is blocked, there is also a spare communication medium to choose from, which improves the reliability of MCTP communication.
[0012] In a possible implementation manner, selecting a target communication medium from the communication medium corresponding to the endpoint identifier includes:
[0013] A communication medium that is capable of communication and has the highest priority is selected from the communication media corresponding to the endpoint identifier as the target communication medium.
[0014] The embodiment of the present application preferentially selects available communication media with large bandwidth for MCTP communication according to priority, thereby ensuring the reliability of MCTP communication.
[0015] In a possible implementation manner, selecting a target communication medium from the communication medium corresponding to the endpoint identifier includes:
[0016] The designated communication medium information is acquired, and if the designated communication medium included in the designated communication medium information is in the communication medium corresponding to the endpoint identifier, the designated communication medium is selected as the target communication medium.
[0017] The embodiment of the present application can also implement MCTP communication using a specified communication medium, which is more flexible.
[0018] In a possible implementation, the method further includes:
[0019] After sending the MCTP data packet to the target MCTP device, if no response information sent by the target MCTP device is received, determining the target communication medium as a communication medium that cannot communicate;
[0020] Re-execute the step of selecting a target communication medium from the communication medium corresponding to the endpoint identifier and subsequent steps.
[0021] In the embodiment of the present application, other alternative communication media can be selected for MCTP communication when communication is blocked, thereby ensuring the reliability of MCTP communication.
[0022] In a possible implementation, the method further includes:
[0023] Assign endpoint identities to MCTP devices;
[0024] The endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier are saved in the object attributes of the MCTP device.
[0025] The embodiment of the present application can allocate endpoint identifiers for the communication media supported by the MCTP device respectively. At the same time, the allocated endpoint identifiers and the corresponding communication media can be saved in the MCTP device object attributes, so as to facilitate the use of subsequent MCTP communication processes.
[0026] In a possible implementation, allocating an endpoint identifier to the MCTP device includes:
[0027] Sending a first broadcast command to reset the MCTP device through a communication interface corresponding to the PCIe communication medium;
[0028] Sending a second broadcast command, and determining the MCTP device that responds to the second broadcast command as the first MCTP device;
[0029] Send a set endpoint identifier command to the first MCTP device according to the physical address of the first MCTP device to assign an endpoint identifier to the first MCTP device.
[0030] The embodiments of the present application can allocate endpoint identifiers to MCTP devices that support PCIe communication media to facilitate the use of subsequent MCTP communication processes.
[0031] In a possible implementation, allocating an endpoint identifier to the MCTP device includes:
[0032] Send a device discovery request via the SMBus communication medium;
[0033] Determine the MCTP device that responds to the device discovery request as a second MCTP device;
[0034] Allocating a physical address to the second MCTP device;
[0035] Send a set endpoint identifier command to the second MCTP device according to the physical address of the second MCTP device to assign an endpoint identifier to the second MCTP device.
[0036] The embodiments of the present application can allocate endpoint identifiers to MCTP devices that support SMBus communication media to facilitate the use of subsequent MCTP communication processes.
[0037] In a possible implementation, allocating an endpoint identifier to the MCTP device includes:
[0038] Sending a third broadcast command through a communication interface corresponding to the I3C communication medium;
[0039] Determine the MCTP device that responds to the third broadcast command as a third MCTP device;
[0040] assigning a physical address to the third MCTP device;
[0041] Send a set endpoint identifier command to the third MCTP device according to the physical address of the third MCTP device to assign an endpoint identifier to the third MCTP device.
[0042] The embodiments of the present application can allocate endpoint identifiers to MCTP devices that support I3C communication media to facilitate the use of subsequent MCTP communication processes.
[0043] In a possible implementation, the method further includes:
[0044] Obtain an endpoint identifier assigned to the MCTP device and a communication medium corresponding to the endpoint identifier;
[0045] The endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier are saved in the object attributes of the MCTP device.
[0046] In the embodiment of the present application, after the CPU allocates an EID to the MCTP device, the EID allocated to the MCTP device can also be obtained from the CPU. Then, the EID of the MCTP device and the communication medium corresponding to the EID are saved in the object attributes of the MCTP device, so as to facilitate the use of the subsequent MCTP communication process.
[0047] In a second aspect, an embodiment of the present application provides a communication device based on a management component transport protocol MCTP, the device comprising:
[0048] A first generating unit is configured to generate a data transmission request, wherein the data transmission request includes payload data, multiple endpoint identifiers of a target MCTP device, and a communication medium corresponding to the endpoint identifier;
[0049] A selection unit, configured to select a target communication medium in the communication medium corresponding to the endpoint identifier;
[0050] A second generating unit, configured to generate an MCTP data packet corresponding to the target communication medium according to the data sending request;
[0051] A sending unit is used to send the MCTP data packet to the target MCTP device through a communication interface corresponding to the target communication medium.
[0052] In a third aspect, an embodiment of the present application provides a communication device based on the Management Component Transport Protocol (MCTP), comprising: a processor, which implements the above-mentioned communication method based on the Management Component Transport Protocol (MCTP) when executing a computer program stored in a memory.
[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the communication method based on the Management Component Transport Protocol MCTP as described above.
[0054] When the embodiment of the present application needs to communicate with the MCTP device, a data transmission request is first generated, and the data transmission request includes payload data, multiple endpoint identifiers of the target MCTP device, and the communication medium corresponding to each endpoint identifier. Then, the target communication medium can be selected from the communication medium corresponding to the endpoint identifier, and the MCTP data packet of the target communication medium is generated. Finally, the MCTP data packet is sent to the target MCTP device through the communication interface corresponding to the target communication medium. Thus, MCTP communication can be achieved through any one of the multiple communication media supported by the target MCTP device. When one communication medium is blocked, there is also a spare communication medium to choose from, which improves the reliability of MCTP communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 is a schematic diagram of MCTP communication in the related art;
[0056] Figure 2 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;
[0057] Figure 3 A flow chart of a communication method based on MCTP provided in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of a communication method based on MCTP provided in an embodiment of the present application;
[0059] Figure 5 A schematic diagram of an implementation architecture of a communication method based on MCTP provided in an embodiment of the present application;
[0060] Figure 6A schematic diagram of a communication device based on MCTP provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0062] In order to facilitate understanding and explanation of the technical solution provided by the embodiments of the present application, the background technology of the embodiments of the present application will be described below.
[0063] MCTP is a protocol that is independent of the physical medium and is used for information exchange between components in a computer system. This protocol is independent of the underlying physical bus and is a bus-independent "data link layer" protocol. Figure 1 As shown, a schematic diagram of MCTP communication in an implementation is shown. In an implementation, the BMC may include software modules such as application (application, app), API (application programming interface, application programming interface), and driver, and hardware modules such as hardware interface. When the application needs to communicate with the MCTP device, it can only communicate with the MCTP device through the PCIe communication medium.
[0064] Based on this, the embodiments of the present application also provide a communication method and device based on MCTP, which expands the communication means of MCTP, so that MCTP devices supporting multiple communication media can perform MCTP communication based on any of the multiple communication media, thereby improving the reliability of MCTP communication.
[0065] In order to facilitate understanding of the MCTP-based communication method provided in the embodiment of the present application, Figure 2 See the example scenario shown in the figure. Figure 2 As shown, this figure is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application.
[0066] The MCTP-based communication method provided in the embodiment of the present application can be applied to the BMC in the server. The BMC is a dedicated controller for monitoring and managing the server. In practical applications, the CPU (Central Processing Unit) in the server generally serves as the main processor and the BMC serves as the auxiliary processor. The BMC needs to interact with the MCTP device in the server. The MCTP device is a component in the server, such as a network card, a hard disk, a RAID card, etc.
[0067] In an embodiment of the present application, the BMC can realize that when the BMC needs to communicate with the MCTP device, a data transmission request is first generated, and the data transmission request includes payload data, multiple endpoint identifiers of the target MCTP device, and the communication medium corresponding to each endpoint identifier. Then the target communication medium can be selected from the communication medium corresponding to the endpoint identifier, and the MCTP data packet of the target communication medium is generated. Finally, the MCTP data packet is sent to the target MCTP device through the communication interface corresponding to the target communication medium. Then the BMC can support multiple communication media and select the communication media at the software level, and correspondingly includes communication interfaces corresponding to multiple communication media at the hardware level. Thereby, MCTP communication can be realized through any one of the multiple communication media supported by the target MCTP device. When one communication medium is blocked, there is also a spare communication medium to choose from, which improves the reliability of MCTP communication.
[0068] Those skilled in the art will understand that Figure 2 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.
[0069] To facilitate understanding of the embodiments of the present application, a communication method based on MCTP provided in an embodiment of the present application is described below with reference to the accompanying drawings.
[0070] See also Figure 3 As shown in FIG. 1 , the figure is a flow chart of a communication method based on MCTP provided in an embodiment of the present application, such as Figure 3 As shown, the method may include S301-S304:
[0071] S301: Generate a data transmission request, where the data transmission request includes payload data, multiple endpoint identifiers of a target MCTP device, and a communication medium corresponding to the endpoint identifiers.
[0072] When the BMC needs to perform MCTP communication with a certain MCTP device, the MCTP device is the target MCTP device. The application can obtain multiple endpoint identifiers of the target MCTP device and the communication medium corresponding to each endpoint identifier from the pre-stored object attributes of the target MCTP device.
[0073] Then, the BMC generates a data transmission request including payload data, multiple endpoint identifiers of the target MCTP device, and the communication medium corresponding to the endpoint identifier. Among them, the target MCTP device supports multiple communication media, each communication medium corresponds to an endpoint identifier (endpoint ID, referred to as EID), and the EID can be used as a logical address for the transmission and routing of MCTP data packets between endpoints. For example, the target MCTP device has EID1 and EID2, EID1 corresponds to the PCIe communication medium, and EID2 corresponds to the I3C communication medium. Then, the target MCTP device supports PCIe communication medium and I3C communication medium. The payload data is the actual data that the application needs to transmit to the target MCTP device.
[0074] The BMC may also assign an EID to the communication medium supported by the MCTP device, or obtain the EID of the MCTP device and the corresponding communication medium. The embodiment of the present application will continue to describe the process of saving multiple endpoint identifiers of the MCTP device and the communication medium corresponding to each endpoint identifier into the object attributes of the MCTP device in subsequent embodiments, which will not be repeated here.
[0075] S302: Select a target communication medium from the communication media corresponding to the endpoint identifier.
[0076] In the embodiment of the present application, the adaptation layer in the BMC can select the target communication medium from the communication medium corresponding to the endpoint identifier, that is, select the target communication medium from the communication medium supported by the acquired target MCTP device, and the target communication medium is the communication medium used for data transmission. For the application, the specific communication medium for transmitting data is not perceived, but the adaptation layer selects a reasonable communication medium. In actual applications, the process of selecting the target communication medium can be implemented by the public communication interface in the adaptation layer. In actual applications, the schematic diagram of the implementation architecture of BMC can be found in the subsequent Figure 5 The corresponding embodiments are described below and will not be elaborated here.
[0077] The principle of selecting the target communication medium is to select an available and high-priority communication medium. The higher the priority of the communication medium, the larger the bandwidth of the communication medium. That is, the communication medium with the highest priority is selected for use first. When communication cannot be performed, the communication medium with the second highest priority is selected for use according to the priority order, and so on. Thereby, the communication medium with large bandwidth is selected for use first. In the embodiment of the present application, the priorities of the communication media that may be used for each MCTP communication can be sorted in advance. For example, the PCIE communication medium with the largest bandwidth has the highest priority, the I3C communication medium with the second highest bandwidth has the second highest priority, the SMbus communication medium with the third highest bandwidth has the third highest priority, and so on.
[0078] S303: Generate an MCTP data packet corresponding to the target communication medium according to the data sending request.
[0079] The basic transmission unit of MCTP is the MCTP data packet. The MCTP basic protocol defines the common fields of the MCTP data packet and the purpose of the MCTP data packet. According to the payload data in the data transmission request, the target communication medium, and the endpoint identifier corresponding to the target communication medium, the MCTP data packet that can be transmitted on the target communication medium can be encapsulated and generated. The process of generating the MCTP data packet can also be implemented by the adaptation layer in the BMC, for example, by the public communication interface in the adaptation layer.
[0080] In the embodiment of the present application, the execution order between S302 and S303 is not limited. For example, in one scenario, according to the data transmission request, MCTP data packets corresponding to each communication medium can be generated, including the MCTP data packet corresponding to the target communication medium. Then S303 generates the MCTP data packet corresponding to the target communication medium according to the data transmission request, and can actually be executed before S302 selects the target communication medium in the communication medium corresponding to the endpoint identifier.
[0081] S304: Send the MCTP data packet to the target MCTP device through the communication interface corresponding to the target communication medium.
[0082] BMC has the underlying communication interface corresponding to each communication medium, and communicates with the MCTP device that supports the communication medium by calling the communication interface. For example, BMC has the communication interface corresponding to the PCIe communication medium. If the MCTP device supports the PCIe communication medium, BMC calls the communication interface corresponding to the PCIe communication medium to send the MCTP data packet.
[0083] In this way, the MCTP data packet corresponding to the target communication medium carries the endpoint identifier of the target MCTP device, and the MCTP data packet can be sent to the target MCTP device through the communication interface corresponding to the target communication medium.
[0084] When the embodiment of the present application needs to communicate with the MCTP device, a data transmission request is first generated, and the data transmission request includes payload data, multiple endpoint identifiers of the target MCTP device, and the communication medium corresponding to each endpoint identifier. Then, the target communication medium can be selected from the communication medium corresponding to the endpoint identifier, and the MCTP data packet of the target communication medium is generated. Finally, the MCTP data packet is sent to the target MCTP device through the communication interface corresponding to the target communication medium. Thus, MCTP communication can be achieved through any one of the multiple communication media supported by the target MCTP device. When one communication medium is blocked, there is also a spare communication medium to choose from, which improves the reliability of MCTP communication.
[0085] In the first application scenario, an available and high-priority communication medium may be selected as the target communication medium. In a possible implementation, the specific implementation of selecting the target communication medium from the communication medium corresponding to the endpoint identifier in S302 may include:
[0086] A communication medium that is capable of communication and has the highest priority is selected from the communication media corresponding to the endpoint identifier as the target communication medium.
[0087] In the embodiment of the present application, the priorities of the communication media that may be used for each MCTP communication may be sorted in advance. At the same time, the communication status of each communication medium can also be marked to indicate whether it can communicate. Thus, the communication medium that can communicate and has the highest priority is selected as the target communication medium from the communication medium corresponding to the endpoint identifier.
[0088] In a possible implementation, the method may further include:
[0089] After the MCTP data packet is sent to the target MCTP device, if no response information sent by the target MCTP device is received, the target communication medium is determined as a communication medium that cannot communicate;
[0090] Re-execute S302 to select a target communication medium from the communication media corresponding to the endpoint identifier and subsequent steps.
[0091] In the first application scenario, after sending an MCTP data packet to a target MCTP device through a target communication medium, the communication state of whether the target communication medium can communicate can be detected by whether a response message is received. If no response message is received, the target communication medium is a communication medium that cannot communicate. Then reselect the target communication medium, specifically, reselect an available and high-priority communication medium as the target communication medium. For example, the PCIE communication medium has the highest priority, the I3C communication medium has the second highest priority, and the SMbus communication medium has the third highest priority. PCIE communication medium is preferentially selected to send MCTP data packets. If the PCIE communication medium is a communication medium that cannot communicate, the I3C communication medium is reselected to send MCTP data packets, and so on.
[0092] In this way, the embodiment of the present application preferentially selects a communication medium with a large bandwidth for MCTP communication, and when communication is blocked, other spare communication media can also be selected for MCTP communication, thereby ensuring the reliability of MCTP communication.
[0093] In the second application scenario, the target communication medium may also be specified. In a possible implementation, the specific implementation of selecting the target communication medium from the communication medium corresponding to the endpoint identifier in S302 may include:
[0094] The designated communication medium information is obtained, and if the designated communication medium included in the designated communication medium information is in the communication medium corresponding to the endpoint identifier, the designated communication medium is selected as the target communication medium.
[0095] If a designated communication medium is required, after the user triggers the selection of the designated communication medium, the BMC can obtain the designated communication medium information. The designated communication medium information includes the designated communication medium, and when selecting the target communication medium, the designated communication medium is used as the target communication medium.
[0096] In a possible implementation, the method may further include:
[0097] After the MCTP data packet is sent to the target MCTP device, if no response information sent by the target MCTP device is received, the target communication medium is determined as a communication medium that cannot communicate;
[0098] Re-execute S302 to select a target communication medium from the communication media corresponding to the endpoint identifier and subsequent steps.
[0099] Similarly, in the second application scenario, after sending an MCTP data packet to the target MCTP device through the target communication medium, the communication state of whether the target communication medium can communicate can be detected by whether the response information is received. If the response information is not received, the target communication medium is a communication medium that cannot communicate. Then reselect the target communication medium, specifically, reselect an available and high-priority communication medium as the target communication medium. For example, the PCIE communication medium has the highest priority, the SMbus communication medium has the second priority, and the I3C communication medium has the third priority. If the communication medium is specified as the SMbus communication medium, the SMbus communication medium is preferentially selected to send the MCTP data packet. If the SMbus communication medium is a communication medium that cannot communicate, the PCIE communication medium is reselected to send the MCTP data packet. If the PCIE communication medium is a communication medium that cannot communicate, the I3C communication medium is reselected to send the MCTP data packet, and so on.
[0100] In addition, based on the second application scenario, if MCTP communication is used to allocate EIDs to MCTP devices, send MCTP control messages, and other scenarios, only the specified communication medium can be used as the target communication device, and other communication media cannot be reselected.
[0101] In this way, the embodiment of the present application preferentially selects the designated communication medium for MCTP communication, and when communication is blocked, other spare communication media can also be selected for MCTP communication, thereby ensuring the reliability of MCTP communication.
[0102] See also Figure 4As shown, a schematic diagram of a communication method based on MCTP provided in an embodiment of the present application is shown.
[0103] When the BMC application needs to perform MCTP communication with a certain MCTP device, multiple endpoint identifiers of the target MCTP device and the communication media corresponding to the endpoint identifiers are obtained. For example, the corresponding relationship between the endpoint identifier and the communication medium includes EID1, communication medium 1, EID2, communication medium 2, and EID3, communication medium 3.
[0104] The BMC can establish a sequence table for selecting communication media according to the priority of the communication media and the correspondence between the endpoint identifier and the communication media, and the sequence table can also record the communication status of whether the communication medium can communicate. Thus, when communicating with the MCTP device, the target communication medium is selected according to the sequence in the sequence table.
[0105] During the communication process, that is, when sending an MCTP data packet to the MCTP device, if the communication is successful, the communication ends. If the communication is unsuccessful, the communication state of the current target communication medium is changed to unable to communicate. If there is still a communication medium that can communicate in the sequence table, the target communication medium is reselected. If there is no communication medium that can communicate in the sequence table, the communication ends and the communication fails.
[0106] In the embodiment of the present application, the communication means of the MCTP network are expanded, so that the MCTP device that supports multiple communication media can have multiple communication interaction means. The upper-layer application does not call the communication interface of the specific communication medium, but automatically selects the communication medium through the adaptation layer, and switches to the backup communication medium when one communication medium is not available. In addition, compared with the existing technical solutions, since the embodiment of the present application can specify the communication medium, it can also perform MCTP communication with the MCTP device hanging under the non-segment0 segment of the Intel CPU or the MCTP device hanging under the Broadcom PCIe Switch, which expands the scope of MCTP network management.
[0107] The following further describes the process of saving multiple endpoint identifiers of the MCTP device and the communication medium corresponding to each endpoint identifier into the object attributes of the MCTP device.
[0108] In a possible implementation manner, the MCTP-based communication method provided in the embodiment of the present application may also include:
[0109] A1: Assign an endpoint identity to the MCTP device.
[0110] A2: Save the endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier into the object attributes of the MCTP device.
[0111] In some server models, the BMC can assign an EID to the MCTP device as the bus owner, and then save the EID of the MCTP device and the communication medium corresponding to the EID into the object properties of the MCTP device.
[0112] The process of discovering MCTP devices and assigning EIDs to MCTP devices varies depending on the communication medium.
[0113] In a possible implementation, the specific implementation of A1 allocating an endpoint identifier to the MCTP device may include:
[0114] Sending a first broadcast command to reset the MCTP device through a communication interface corresponding to the PCIe communication medium;
[0115] Sending a second broadcast command, and determining the MCTP device that responds to the second broadcast command as the first MCTP device;
[0116] Send a set endpoint identifier command to the first MCTP device based on the physical address of the first MCTP device to assign an endpoint identifier to the first MCTP device.
[0117] It can be understood that the PCIe communication medium is one of the communication media. In the PCIe communication medium, a first broadcast command, such as a prepare broadcast command, is first sent to reset the MCTP device. Then a second broadcast command, such as an EPDiscovery broadcast command, is sent to notify the MCTP device to which the EID is assigned to respond to the command. After the BMC receives a response to the second broadcast command, these MCTP devices are the first MCTP devices. They can be recorded in a device list, and finally a set endpoint identifier (SET EID) command is sent to the first MCTP device in the device list according to the physical address it responds to, so as to assign an EID to the first MCTP device.
[0118] In a possible implementation, the specific implementation of A1 allocating an endpoint identifier to the MCTP device may include:
[0119] Send a device discovery request via the SMBus communication medium;
[0120] Determine the MCTP device that responds to the device discovery request as a second MCTP device;
[0121] Assign a physical address to the second MCTP device;
[0122] Send a set endpoint identifier command to the second MCTP device according to the physical address of the second MCTP device to assign an endpoint identifier to the second MCTP device.
[0123] It can be understood that the SMBus communication medium is one of the communication media. In the SMBus communication medium, the MCTP devices supported by the SMBus communication medium are first dynamically discovered according to the ARP (Address Resolution Protocol) mechanism of the SMBus, and these MCTP devices are the second MCTP devices. The SMBus physical addresses are first dynamically allocated to these second MCTP devices, and then the SET EID command is sent through its physical address to allocate an EID to the second MCTP device.
[0124] In a possible implementation, the specific implementation of A1 allocating an endpoint identifier to the MCTP device may include:
[0125] Sending a third broadcast command through a communication interface corresponding to the I3C communication medium;
[0126] Determine the MCTP device that responds to the third broadcast command as a third MCTP device;
[0127] Assigning a physical address to the third MCTP device;
[0128] Send a set endpoint identifier command to the third MCTP device according to the physical address of the third MCTP device to assign an endpoint identifier to the third MCTP device.
[0129] It can be understood that the I3C communication medium is one of the communication media. In the I3C communication medium, the BMC keeps sending the third broadcast command, such as the ENTDAA broadcast message, and the MCTP devices that have not been assigned an I3C physical address will respond to the third broadcast command. These MCTP devices are the third MCTP devices. The third MCTP device is recorded until no response to the third broadcast command is received. The I3C physical address is first assigned to these third MCTP devices, and then the SET EID command is sent through its physical address to assign an EID to the third MCTP device.
[0130] In each of the above communication media, an MTCP device with a static physical address directly sends a SET EID command to it to allocate an EID.
[0131] In this way, EIDs can be assigned to the communication media supported by the MCTP device respectively. At the same time, the assigned EIDs and the corresponding communication media can be saved to the MCTP device object attributes in the application, so as to facilitate the subsequent MCTP communication process.
[0132] In a possible implementation, the MCTP-based communication method provided in the embodiment of the present application may also include:
[0133] B1: Obtain the endpoint identifier assigned to the MCTP device and the communication medium corresponding to the endpoint identifier:.
[0134] B2: Save the endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier into the object attributes of the MCTP device.
[0135] In some server models, the CPU can be used as the bus owner to assign an EID to the MCTP device. The BMC needs to obtain the EID assigned to the MCTP device from the CPU. The EID of the MCTP device and the communication medium corresponding to the EID are then saved in the object properties of the MCTP device, which is convenient for subsequent MCTP communication processes.
[0136] See also Figure 5 As shown, a schematic diagram of an implementation architecture of a communication method based on MCTP provided in an embodiment of the present application. The BMC may include an MCTP EID allocation module, an application, a public communication interface, and a bottom interface of a communication medium. The bottom interface of the communication medium may include, for example, a PCIE bottom interface, an SMBus bottom interface, and an I3C bottom interface. Among them, the MCTP EID allocation module, the application, and the public communication interface belong to software modules, and the bottom interface of the communication medium belongs to a hardware module.
[0137] The MCTP EID allocation module allocates and reclaims EIDs for each communication medium supported by the MCTP device, and sets the allocated EID and the corresponding communication medium to the MCTP object attributes in the application app.
[0138] The public communication interface provides a unified communication API to the MCTP EID allocation module and other application apps. The MCTP EID allocation module and other application apps access the MCTP device through the unified public communication interface.
[0139] When the application object needs to communicate with the MCTP device, the public communication interface does not need to specify the communication medium. That is, the application does not perceive the specific communication medium difference. The public communication interface selects a reasonable communication medium and can switch to an alternative communication medium to continue to try to communicate when the communication medium is blocked. In actual applications, the public communication interface gives priority to the communication medium with large bandwidth and availability, and then calls the underlying interface corresponding to the communication medium.
[0140] The MCTP EID allocation module needs to allocate EIDs according to the communication medium. In the process of allocating EIDs for different communication media, the underlying interface used must be fixed, so the specified communication medium can be used when calling the public communication interface.
[0141] In this way, the embodiment of the present application implements the EID allocation management of MCTP devices of each communication medium under the MCTP network. The upper-layer application app has a unified sending and receiving interface, and calls the public communication interface to give priority to the communication medium with large bandwidth. When the communication is blocked, other spare communication media are used for communication. Of course, the public communication interface can also use the specified communication medium for communication according to the specified fixed method. For example, it is necessary to use the specified communication medium during the EID allocation process. In addition, for the situation where the MCTP device hanging under the non-segment0 segment of Intel CPU or the MCTP device hanging under Broadcom PCIe Switch cannot be managed through the PCIe communication medium, an additional communication medium is provided for MCTP communication.
[0142] Based on the MCTP-based communication method provided in the above method embodiment, the embodiment of the present application also provides a MCTP-based communication device, which will be described below in conjunction with the accompanying drawings.
[0143] See also Figure 6 As shown in FIG. 1 , this figure is a schematic diagram of the structure of a communication device based on MCTP provided in an embodiment of the present application. Figure 6 As shown, the MCTP-based communication device includes:
[0144] A first generating unit 601 is configured to generate a data transmission request, wherein the data transmission request includes payload data, multiple endpoint identifiers of a target MCTP device, and a communication medium corresponding to the endpoint identifier;
[0145] A selection unit 602, configured to select a target communication medium in the communication medium corresponding to the endpoint identifier;
[0146] A second generating unit 603 is configured to generate an MCTP data packet corresponding to the target communication medium according to the data sending request;
[0147] The sending unit 604 is configured to send the MCTP data packet to the target MCTP device through the communication interface corresponding to the target communication medium.
[0148] In a possible implementation manner, the selection unit is specifically configured to:
[0149] A communication medium that is capable of communication and has the highest priority is selected from the communication media corresponding to the endpoint identifier as the target communication medium.
[0150] In a possible implementation manner, the selection unit is specifically configured to:
[0151] The designated communication medium information is acquired, and if the designated communication medium included in the designated communication medium information is in the communication medium corresponding to the endpoint identifier, the designated communication medium is selected as the target communication medium.
[0152] In a possible implementation manner, the device further includes:
[0153] a determining unit, configured to determine the target communication medium as a communication medium that cannot communicate if no response information sent by the target MCTP device is received after the MCTP data packet is sent to the target MCTP device;
[0154] The triggering unit is used to trigger the selecting unit to re-execute the selecting of the target communication medium from the communication medium corresponding to the endpoint identifier.
[0155] In a possible implementation manner, the device further includes:
[0156] An allocation unit, configured to allocate endpoint identifiers to MCTP devices;
[0157] The first saving unit is configured to save the endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier into the object attributes of the MCTP device.
[0158] In a possible implementation manner, the allocation unit is specifically configured to:
[0159] Sending a first broadcast command to reset the MCTP device through a communication interface corresponding to a PCIe communication medium, wherein the PCIe communication medium is one of the communication media;
[0160] Sending a second broadcast command, and determining the MCTP device that responds to the second broadcast command as the first MCTP device;
[0161] Send a set endpoint identifier command to the first MCTP device according to the physical address of the first MCTP device to assign an endpoint identifier to the first MCTP device.
[0162] In a possible implementation manner, the allocation unit is specifically configured to:
[0163] Sending a device discovery request via an SMBus communication medium, wherein the SMBus communication medium is one of the communication media;
[0164] Determine the MCTP device that responds to the device discovery request as a second MCTP device;
[0165] Allocating a physical address to the second MCTP device;
[0166] Send a set endpoint identifier command to the second MCTP device according to the physical address of the second MCTP device to assign an endpoint identifier to the second MCTP device.
[0167] In a possible implementation manner, the allocation unit is specifically configured to:
[0168] Sending a third broadcast command through a communication interface corresponding to an I3C communication medium, wherein the I3C communication medium is one of the communication media;
[0169] Determine the MCTP device that responds to the third broadcast command as a third MCTP device;
[0170] assigning a physical address to the third MCTP device;
[0171] Send a set endpoint identifier command to the third MCTP device according to the physical address of the third MCTP device to assign an endpoint identifier to the third MCTP device.
[0172] In a possible implementation manner, the device further includes:
[0173] An acquisition unit, configured to acquire an endpoint identifier assigned to the MCTP device and a communication medium corresponding to the endpoint identifier;
[0174] The second saving unit is configured to save the endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier into the object attributes of the MCTP device.
[0175] In addition, an embodiment of the present application further provides a communication device based on MCTP, including a processor, wherein when the processor executes a computer program stored in a memory, the communication method based on MCTP as described in any one of the above items is implemented. Among them, the communication device based on MCTP provided in an embodiment of the present application may be a server, and the processor may be a BMC in the server.
[0176] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the MCTP-based communication method as described in any one of the above items.
[0177] An embodiment of the present application further provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the MCTP-based communication method as described in any one of the above items.
[0178] When the embodiment of the present application needs to communicate with the MCTP device, a data transmission request is first generated, and the data transmission request includes payload data, multiple endpoint identifiers of the target MCTP device, and the communication medium corresponding to each endpoint identifier. Then, the target communication medium can be selected from the communication medium corresponding to the endpoint identifier, and the MCTP data packet of the target communication medium is generated. Finally, the MCTP data packet is sent to the target MCTP device through the communication interface corresponding to the target communication medium. Thus, MCTP communication can be achieved through any one of the multiple communication media supported by the target MCTP device. When one communication medium is blocked, there is also a spare communication medium to choose from, which improves the reliability of MCTP communication.
[0179] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0180] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0181] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0182] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0183] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A communication method based on the Management Component Transport Protocol (MCTP), characterized in that: The method comprises: Generate a data transmission request, the data transmission request including payload data, multiple endpoint identifiers of a target MCTP device, and a communication medium corresponding to the endpoint identifier; Selecting a target communication medium from the communication media corresponding to the endpoint identifier; Generate an MCTP data packet corresponding to the target communication medium according to the data sending request; The MCTP data packet is sent to the target MCTP device through a communication interface corresponding to the target communication medium.
2. The method according to claim 1, characterized in that The selecting a target communication medium from the communication medium corresponding to the endpoint identifier includes: A communication medium that is capable of communication and has the highest priority is selected from the communication media corresponding to the endpoint identifier as the target communication medium.
3. The method according to claim 1, characterized in that: The selecting a target communication medium from the communication medium corresponding to the endpoint identifier includes: The designated communication medium information is acquired, and if the designated communication medium included in the designated communication medium information is in the communication medium corresponding to the endpoint identifier, the designated communication medium is selected as the target communication medium.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: After sending the MCTP data packet to the target MCTP device, if no response information sent by the target MCTP device is received, determining the target communication medium as a communication medium that cannot communicate; Re-execute the step of selecting a target communication medium from the communication medium corresponding to the endpoint identifier and subsequent steps.
5. The method according to claim 1, characterized in that The method further comprises: Assign endpoint identities to MCTP devices; The endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier are saved in the object attributes of the MCTP device.
6. The method according to claim 5, characterized in that The allocating an endpoint identifier to the MCTP device includes: Sending a first broadcast command to reset the MCTP device through a communication interface corresponding to a PCIe communication medium, wherein the PCIe communication medium is one of the communication media; Sending a second broadcast command, and determining the MCTP device that responds to the second broadcast command as the first MCTP device; Send a set endpoint identifier command to the first MCTP device according to the physical address of the first MCTP device to assign an endpoint identifier to the first MCTP device.
7. The method according to claim 5, characterized in that The allocating an endpoint identifier to the MCTP device includes: Sending a device discovery request via an SMBus communication medium, wherein the SMBus communication medium is one of the communication media; Determine the MCTP device that responds to the device discovery request as a second MCTP device; assigning a physical address to the second MCTP device; Send a set endpoint identifier command to the second MCTP device according to the physical address of the second MCTP device to assign an endpoint identifier to the second MCTP device.
8. The method according to claim 5, characterized in that The allocating an endpoint identifier to the MCTP device includes: Sending a third broadcast command through a communication interface corresponding to an I3C communication medium, wherein the I3C communication medium is one of the communication media; Determine the MCTP device that responds to the third broadcast command as a third MCTP device; assigning a physical address to the third MCTP device; Send a set endpoint identifier command to the third MCTP device according to the physical address of the third MCTP device to assign an endpoint identifier to the third MCTP device.
9. The method according to claim 1, characterized in that: The method further comprises: Obtain an endpoint identifier assigned to the MCTP device and a communication medium corresponding to the endpoint identifier; The endpoint identifier of the MCTP device and the communication medium corresponding to the endpoint identifier are saved in the object attributes of the MCTP device.
10. A communication device based on the Management Component Transport Protocol (MCTP), characterized in that: include: A processor, wherein when executing a computer program stored in a memory, the processor implements the communication method based on the Management Component Transport Protocol (MCTP) as described in any one of claims 1 to 9.
Citation Information
Cited By
Out-of-band management method, device and system and computer readable storage medium
CN121309111A
MCTP message transmission method, and device, storage medium and program product
WO2026158092A1
