Message Transmission Method, Device, Equipment and Medium Based on MCTP Protocol
By adopting a message transmission method based on MCTP protocol in the OpenPOWER server, the MCTP protocol link between the substrate management controller and the basic input and output system is established, and message transmission is transmitted using the LPC bus, the problem of inefficient out-of-band management in the existing technology is solved and more efficient message transmission is achieved.
Patent Information
- Application Number
- CN202211214336.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2042-09-30
AI Technical Summary
In the prior art, the out-of-band management protocol of OpenPOWER server is based on the ipmi protocol of BT hardware, resulting in slow write speed, limited length of single write data, low efficiency, and slow update of the ipmi protocol, which cannot correct the defects in the data format and transmission method in time, resulting in inconvenience of out-of-band management.
The message transmission method based on the MCTP protocol is adopted. By establishing a MCTP protocol link between the substrate management controller and the basic input and output system in the LPC space, and using the LPC bus for message transmission, it supports a larger single message transmission length and a faster transmission rate.
The message transmission efficiency between the substrate management controller and the basic input and output system is improved, and a larger single message transmission length and faster transmission rate are supported, solving the problem of inefficiency in the prior art.
Smart Images

Figure CN115604070B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technologies, and in particular, to a message transmission method, apparatus, device, and medium based on the MCTP protocol. Background Art
[0002] Currently, the rapid development of the Internet has also brought about the prosperity of the server market. During the startup and operation of a server, the BIOS (Basic Input Output System) needs to interact frequently with the BMC (Baseboard Management Controller) to achieve out-of-band management of the server.
[0003] The out-of-band management protocol of OpenPOWER servers is based on the ipmi (Intelligent Platform Management Interface) protocol of BT hardware. Limited by BT hardware devices, its writing speed is slow, and the length of data written at one time cannot exceed 64B. When a large amount of data needs to be transmitted in a single ipmi message, complex software implementation is required, resulting in low efficiency. Moreover, the ipmi protocol is now updated slowly, and some defects in its data formats and transmission methods cannot be corrected in a timely manner, bringing a lot of inconvenience to out-of-band management.
[0004] In summary, how to improve the efficiency of message transmission between the baseboard management controller and the basic input output system is an urgent problem to be solved currently. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a message transmission method, apparatus, device, and medium based on the MCTP protocol, which can improve the efficiency of message transmission between the baseboard management controller and the basic input output system. The specific solutions are as follows:
[0006] In a first aspect, the present application discloses a message transmission method based on the MCTP protocol, including:
[0007] Establish an MCTP protocol link between the baseboard management controller and the basic input output system based on the LPC space;
[0008] Based on the MCTP protocol link and the LPC space, and through the LPC bus, perform message transmission between the baseboard management controller and the basic input output system.
[0009] Optionally, the establishing an MCTP protocol link between the baseboard management controller and the basic input output system based on the LPC space includes:
[0010] Write the first configuration information corresponding to the baseboard management controller to the configuration space in the LPC space through the baseboard management controller; the first configuration information includes the first space allocated for the baseboard management controller in the LPC space and the first maximum single-message transmission length corresponding to the first space.
[0011] Obtain the first configuration information from the configuration space through the basic input / output system, and write the second configuration information corresponding to the basic input / output system to the configuration space; the second configuration information includes the second space allocated for the basic input / output system in the LPC space and the second maximum single-message transmission length corresponding to the second space.
[0012] Obtain the second configuration information from the configuration space through the baseboard management controller to establish an MCTP protocol link between the baseboard management controller and the basic input / output system.
[0013] Optionally, the message transmission between the baseboard management controller and the basic input / output system based on the MCTP protocol link and the LPC space and through the LPC bus includes:
[0014] When the basic input / output system sends a first message to the baseboard management controller, determine, through the basic input / output system based on the first configuration information, the first space in the LPC space where the first message is stored, and determine the first maximum single-message transmission length.
[0015] Split the first message into several first split messages based on the first maximum single-message transmission length through the basic input / output system, and then sequentially send the first split messages to the first space through the basic input / output system based on the MCTP protocol link and through the LPC bus.
[0016] Obtain all the first split messages from the first space in sequence through the baseboard management controller, and then reconstruct the first message based on the first split messages.
[0017] Optionally, the step of obtaining all the first split messages from the first space in sequence through the baseboard management controller and then reconstructing the first message based on the first split messages includes:
[0018] Set the first KCS register to a first value and set the second KCS register to a second value.
[0019] When the Baseboard Management Controller reads that the first KCS register is set to the first value and the second KCS register is set to the second value, obtain all the first split messages from any of the first spaces;
[0020] Set the first KCS register to a third value and set the second KCS register to a fourth value;
[0021] When the Basic Input / Output System reads that the first KCS register is set to the third value and the second KCS register is set to the fourth value, set the first KCS register to a fifth value to indicate that the message transmission is complete, and jump to the step of setting the first KCS register to the first value and setting the second KCS register to the second value, until all the first split messages are obtained from the first space by the Baseboard Management Controller, and then reconstruct the first message based on the first split messages.
[0022] Optionally, the message transmission between the Baseboard Management Controller and the Basic Input / Output System based on the MCTP protocol link and the LPC space and through the LPC bus includes:
[0023] When the Baseboard Management Controller sends a second message to the Basic Input / Output System, determine, by the Baseboard Management Controller based on the second configuration information, the second space in the LPC space where the second message is stored, and determine the second maximum single-message transmission length;
[0024] Split the second message by the Baseboard Management Controller based on the second maximum single-message transmission length to obtain a number of second split messages, and then sequentially send the first split messages to the second space by the Basic Input / Output System based on the MCTP protocol link and through the LPC bus;
[0025] Sequentially obtain all the second split messages from the second space by the Basic Input / Output System, and then reconstruct the second message based on the second split messages.
[0026] Optionally, the sequentially obtaining all the second split messages from the second space by the Basic Input / Output System and then reconstructing the second message based on the second split messages includes:
[0027] Set the first KCS register to the first value and set the second KCS register to the fourth value;
[0028] When the first KCS register is read by the basic input / output system and set to the first value, and the second KCS register is set to the fourth value, any of the second split messages is retrieved from the second space;
[0029] Set the first KCS register to a third value and set the second KCS register to a second value;
[0030] When the first KCS register is read by the basic input / output system and set to the third value, and the second KCS register is set to the second value, set the first KCS register to a fifth value to indicate that the message transmission is complete, and jump to the step of setting the first KCS register to the first value and setting the second KCS register to the fourth value, until all the second split messages are obtained from the second space through the basic input / output system, and then reconstruct the second message based on the second split messages.
[0031] Optionally, splitting the second message by the baseboard management controller based on the second maximum single-message transmission length to obtain a plurality of second split messages, then linking through the basic input / output system based on the MCTP protocol, and sequentially sending the first split messages to the second space through the LPC bus, includes:
[0032] Splitting the second message by the baseboard management controller based on the second maximum single-message transmission length to obtain a plurality of second split messages, and setting a target header indicating the position in the second message for each of the second split messages;
[0033] Linking through the basic input / output system based on the MCTP protocol, and sequentially sending the first split messages with the target header to the second space through the LPC bus;
[0034] Correspondingly, retrieving all the second split messages from the second space in sequence through the basic input / output system, and then reconstructing the second message based on the second split messages, includes:
[0035] Retrieving all the second split messages from the second space in sequence through the basic input / output system, and then reconstructing the second message based on the second split messages and the target header.
[0036] In a second aspect, the present application discloses a message transmission device based on the MCTP protocol, including:
[0037] A link establishment module, configured to establish an MCTP protocol link between a baseboard management controller and a basic input / output system based on the LPC space;
[0038] A message transmission module, configured to perform message transmission between the baseboard management controller and the basic input / output system based on the MCTP protocol link and the LPC space, and through the LPC bus.
[0039] In a third aspect, the present application discloses an electronic device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the method for message transmission based on the MCTP protocol disclosed above is implemented.
[0040] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the method for message transmission based on the MCTP protocol disclosed above is implemented.
[0041] It can be seen that the present application establishes an MCTP protocol link between a baseboard management controller and a basic input / output system based on the LPC space; performs message transmission between the baseboard management controller and the basic input / output system based on the MCTP protocol link and the LPC space, and through the LPC bus. Thus, it can be seen that the present application realizes data transmission between the baseboard management controller and the basic input / output system by establishing an MCTP protocol link, wherein the LPC space has a relatively large space range and can support a relatively large single-message transmission length; in addition, the transmission rate of the LPC bus corresponding to the MCTP protocol is relatively fast; therefore, the relatively large single-message transmission length and the relatively fast transmission rate improve the message transmission efficiency between the baseboard management controller and the basic input / output system. Description of the Drawings
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0043] Figure 1 It is a flowchart of a method for message transmission based on the MCTP protocol provided by the present application;
[0044] Figure 2 It is a flowchart of a specific method for message transmission based on the MCTP protocol provided by the present application;
[0045] Figure 3 It is a schematic diagram of the process of establishing an MCTP protocol link provided by the present application;
[0046] Figure 4 Schematic diagram of the unpacking and packet assembling process during message transmission provided for this application;
[0047] Figure 5 Schematic diagram of the single - packet data sending process from the basic input / output system to the baseboard management controller provided for this application;
[0048] Figure 6 Flowchart of a specific message transmission method based on the MCTP protocol provided for this application;
[0049] Figure 7 Schematic diagram of the single - packet data sending process from the baseboard management control system to the basic input / output system provided for this application;
[0050] Figure 8 Schematic diagram of the structure of a message transmission device based on the MCTP protocol provided for this application;
[0051] Figure 9 Structure diagram of an electronic device provided for this application. Detailed implementation manners
[0052] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0053] Currently, the out - of - band management protocol of OpenPOWER servers is the ipmi protocol based on BT hardware. Limited by BT hardware devices, its writing speed is slow, and the length of data written at one time cannot exceed 64B. When a large amount of data needs to be transmitted in a single ipmi message, complex software implementation is required, resulting in low efficiency. Moreover, the ipmi protocol is now updated slowly, and some defects in data formats and transmission methods cannot be corrected in time, bringing a lot of inconvenience to out - of - band management.
[0054] To overcome the above problems, this application provides a message transmission solution based on the MCTP protocol, which can improve the efficiency of message transmission between the baseboard management controller and the basic input / output system.
[0055] See Figure 1 As shown, an embodiment of this application discloses a message transmission method based on the MCTP protocol, and the method includes:
[0056] Step S11: Establish an MCTP protocol link between the baseboard management controller and the basic input / output system based on the LPC space.
[0057] In the embodiment of the present application, an MCTP protocol link is established between the baseboard management controller and the basic input / output system based on the configuration space in the LPC (Low Pin Count) space. The low pin count bus is a bus that connects low-speed devices to the CPU (Central Processing Unit).
[0058] Step S12: Based on the MCTP protocol link and the LPC space, perform message transmission between the baseboard management controller and the basic input / output system through the LPC bus.
[0059] In the embodiment of the present application, based on the MCTP (Management Component Transport Protocol) protocol link and the first space in the LPC space, perform message transmission from the baseboard management controller to the basic input / output system through the LPC bus; based on the MCTP protocol link and the second space in the LPC space, perform message transmission from the basic input / output system to the baseboard management controller through the LPC bus. It should be noted that the first space and the second space can be 32KB spaces, which is the data length written at one time. Compared with the 64B data length written at one time in the prior art, the present application significantly increases the data length written at one time.
[0060] It should be noted that to complete the above steps, the hardware part of the present application uses a general server, the KCS (Keyboard Controller Style) register of the BMC chip, the LPC controller of the BMC chip, and the CPU LPC controller. It should be noted that the data transmission through the LPC bus has a higher transmission rate compared with the existing reading and writing of BT hardware.
[0061] In summary, in the embodiment of the present application, after the server is powered on, the BMC initializes an mctp process, writes the first configuration information of the mctp protocol stack at a fixed position (configuration space) in the LPC mapping space, and then sets the KCS register to 0x81 to notify the BIOS to read the first configuration information; after the server boots, the CPU is powered on, the BIOS receives the value written by the BMC to the KCS register, starts to read the first configuration information, verifies its legality, and completes the second configuration information that needs to be written by the BIOS, writes it into the LPC configuration space, and notifies the BMC to read the second configuration information with the KCS register value of 0x82.
[0062] It should be noted that the legality verification is carried out by generating the first hash value of the first configuration information, sending the first hash value and the first configuration information together to a fixed position in the LPC mapping space, the BIOS reads the first configuration information and generates the second hash value, and judges whether the first hash value is the same as the second hash value. If they are the same, the verification passes.
[0063] It can be seen that this application establishes an MCTP protocol link between the baseboard management controller and the basic input / output system based on the LPC space; based on the MCTP protocol link and the LPC space, and through the LPC bus, message transmission between the baseboard management controller and the basic input / output system is carried out. Thus, this application realizes data transmission between the baseboard management controller and the basic input / output system by establishing an MCTP protocol link. Among them, the space range of the LPC space is relatively large, which can support a relatively large single-message transmission length; in addition, the transmission rate of the LPC bus corresponding to the MCTP protocol is relatively fast; therefore, the relatively large single-message transmission length and the relatively fast transmission rate improve the message transmission efficiency between the baseboard management controller and the basic input / output system.
[0064] See Figure 2 As shown, an embodiment of this application discloses a specific message transmission method based on the MCTP protocol. The method includes:
[0065] Step S21: Write the first configuration information corresponding to the baseboard management controller into the configuration space in the LPC space through the baseboard management controller; the first configuration information includes the first space allocated for the baseboard management controller in the LPC space and the first maximum single-message transmission length corresponding to the first space.
[0066] Step S22: Obtain the first configuration information from the configuration space through the basic input / output system, and write the second configuration information corresponding to the basic input / output system into the configuration space; the second configuration information includes the second space allocated for the basic input / output system in the LPC space and the second maximum single-message transmission length corresponding to the second space.
[0067] Step S23: Obtain the second configuration information from the configuration space through the baseboard management controller to establish an MCTP protocol link between the baseboard management controller and the basic input / output system.
[0068] In an embodiment of this application, the first space and the second space are different spaces, and the sizes of the first space and the second space can be 32KB respectively.
[0069] In an embodiment of this application, the specific link establishment process is as Figure 3As shown, when transferring configuration information between the baseboard management controller and the basic input / output system, the first KCS register is utilized. After writing the first configuration information corresponding to the baseboard management controller into the configuration space in the LPC space through the baseboard management controller, the value of the first KCS register is set to the sixth value; when the basic input / output system detects that the value of the first KCS register is the sixth value, the basic input / output system obtains the first configuration information from the LPC space and writes the second configuration information corresponding to the basic input / output system into the LPC space; thereafter, the value of the first KCS register is set to the seventh value; when the baseboard management controller detects that the value of the first KCS register is the seventh value, the baseboard management controller obtains the second configuration information from the LPC space.
[0070] It should be noted that the initial value of the first KCS register is 0x80. When the value of the first KCS register is set to the sixth value and the seventh value, it indicates that a link is being established and normal message transmission cannot be performed; the sixth value is 0x81, and the seventh value is 0x82. It should be noted that after obtaining the second configuration information from the LPC space through the baseboard management controller, the value of the first KCS register is set to the eighth value to indicate that data transmission can be performed; the eighth value is 0xC0. It should be noted that the value of the second KCS register is always the ninth value, 0xff, during the link establishment phase.
[0071] It should be noted that as Figure 3 shown, the first KCS register is the KCS Status Reg, and the second KCS register is the KCS Data Reg; BMC represents the baseboard management controller, and HOST represents the host, which stands for the basic input / output system.
[0072] Step S24: When the basic input / output system sends the first message to the baseboard management controller, the basic input / output system determines the first space in the LPC space where the first message is stored based on the first configuration information and determines the first maximum single-message transmission length.
[0073] Step S25: The basic input / output system splits the first message into several first split messages based on the first maximum single-message transmission length, then links based on the MCTP protocol through the basic input / output system, and sequentially sends the first split messages to the first space through the LPC bus.
[0074] In the embodiment of the present application, splitting the first message into a plurality of first split messages based on the first maximum single-message transmission length by the basic input / output system, then linking through the MCTP protocol by the basic input / output system, and sequentially sending the first split messages to the first space through the LPC bus includes: splitting the first message into a plurality of first split messages based on the first maximum single-message transmission length by the basic input / output system, and setting a target header indicating the position in the first message for each of the first split messages; linking through the MCTP protocol by the basic input / output system, and sequentially sending the first split messages with the target header set to the first space through the LPC bus. It should be noted that the target header and the first split message can occupy 32KB.
[0075] It should be noted that after the BIOS slices the data to be sent into packets of appropriate sizes, it needs to attach a header in front of the packet to indicate the position of the packet in the message, so as to correctly reconstruct the message according to the position during subsequent message reconstruction.
[0076] It should be noted that as the transport layer implementation of the PLDM protocol, the MCTP protocol can implement the PLDM protocol through simple software coding on a platform equipped with the MCTP protocol stack. In this way, out-of-band management can be carried out using the PLDM protocol during the server startup and operation processes. Therefore, during specific message transmission, attention needs to be paid to the unpacking and repacking processes during transmission, as Figure 4 shown, are the unpacking and repacking processes during message transmission. During the unpacking process, first construct a PLDM message based on the PLDM protocol, construct an MCTP message based on the PLDM message and the MCTP protocol, then split the MCTP message, and for each split packet, set a target header (header) to indicate the position of the packet in the message; then, construct an LPC FW Space based on the packet with the target header set for transmission through the LPC bus. The repacking process, as Figure 5 shown, is the overall opposite of the unpacking process.
[0077] Step S26: sequentially obtain all the first split messages from the first space by the baseboard management controller, and then reconstruct the first message based on the first split messages.
[0078] In the embodiment of the present application, the process of sequentially obtaining all the first split messages from the first space through the baseboard management controller and then reconstructing the first message based on the first split messages includes: sequentially obtaining all the first split messages with the target header from the first space through the baseboard management controller, and then reconstructing the first message based on the first split messages and the target header.
[0079] In the embodiment of the present application, when the basic input / output system sends a first message to the baseboard management controller, the first KCS register and the second KCS register are required to control the transmission of the message.
[0080] In the embodiment of the present application, the process of sequentially obtaining all the first split messages from the first space through the baseboard management controller and then reconstructing the first message based on the first split messages includes: when the baseboard management controller reads that the first KCS register is set to the first value and the second KCS register is set to the second value, obtaining all the first split messages from any position in the first space; setting the first KCS register to a third value and setting the second KCS register to a fourth value; when the basic input / output system reads that the first KCS register is set to the third value and the second KCS register is set to the fourth value, setting the first KCS register to a fifth value to indicate that the message transmission is completed, and jumping to the step of setting the first KCS register to the first value and setting the second KCS register to the second value, until all the first split messages are obtained from the first space through the baseboard management controller, and then reconstructing the first message based on the first split messages.
[0081] It should be noted that the specific process is as Figure 5 shown, which is the process of sending a single-packet data from the basic input / output system to the basic management controller. The first value is 0xC1, the second value is 0x01; the third value is 0xC2, the fourth value is 0x02; the fifth value is 0xC0.
[0082] It should be noted that as Figure 5As shown in the figure, it is the process of sending single-packet data from the basic input / output system to the basic management controller. When the BIOS has a message to send to the BMC, the BIOS reads the configuration information to determine the location in the LPC space where the message data is stored and the maximum length of data that can be written each time. Then the BIOS cuts the data to be sent into packets of appropriate sizes. After that, the single-packet data sending is to be carried out. The BIOS writes the packets to the location specified by the configuration information, sets the value of the first KCS register to 0xC2, and sets the value of the second KCS register to 0x01 to notify the BMC to receive the packets. When the BMC detects that the value of the first KCS register is set to 0xC2 and the value of the second KCS register is set to 0x01, it reads the data in the packets at the specified location, parses the data in the packets, and then sets the value of the first KCS register to 0xC1 and the value of the second KCS register to 0x02. When the BIOS detects that the value of the first KCS register is set to 0xC1 and the value of the second KCS register is set to 0x02, it indicates that the data has been read, and then sets the value of the first KCS register to 0xC0 to perform the next single-packet sending until all the packets are sent. At this time, the BMC will reorganize the data in the packets to obtain the complete message.
[0083] It can be seen that this application splits the first message based on the first maximum single-message transmission length, controls the process through the KCS register, and transmits the first message from the input / output system to the baseboard management controller based on the first space and the LPC bus. Among them, the LPC space has a relatively large space range and can support a relatively large single-message transmission length. In addition, the transmission rate of the LPC bus corresponding to the MCTP protocol is relatively fast. Therefore, the relatively large single-message transmission length and the relatively fast transmission rate improve the message transmission efficiency between the baseboard management controller and the basic input / output system. In addition, controlling the transmission process through the KCS can improve the transmission accuracy.
[0084] See Figure 6 As shown in the figure, an embodiment of this application discloses a specific message transmission method based on the MCTP protocol. The method includes:
[0085] Step S31: Write the first configuration information corresponding to the baseboard management controller into the configuration space in the LPC space through the baseboard management controller; the first configuration information includes the first space allocated for the baseboard management controller in the LPC space and the first maximum single-message transmission length corresponding to the first space.
[0086] Step S32: Obtain the first configuration information from the configuration space through the basic input / output system, and write the second configuration information corresponding to the basic input / output system into the configuration space; the second configuration information includes a second space allocated for the basic input / output system in the LPC space and a second maximum single-message transmission length corresponding to the second space.
[0087] Step S33: Obtain the second configuration information from the configuration space through the baseboard management controller to establish an MCTP protocol link between the baseboard management controller and the basic input / output system.
[0088] Step S34: When the baseboard management controller sends a second message to the basic input / output system, determine, by the baseboard management controller based on the second configuration information, the second space in the LPC space where the second message is stored, and determine the second maximum single-message transmission length.
[0089] In an embodiment of the present application, the first space and the second space are different spaces, and the sizes of the first space and the second space can be 32KB respectively.
[0090] Step S35: Split the second message by the baseboard management controller based on the second maximum single-message transmission length to obtain a plurality of second split messages, and then sequentially send the first split message to the second space through the basic input / output system based on the MCTP protocol link and through the LPC bus.
[0091] In an embodiment of the present application, the step of splitting the second message by the baseboard management controller based on the second maximum single-message transmission length to obtain a plurality of second split messages, and then sequentially sending the first split message to the second space through the basic input / output system based on the MCTP protocol link and through the LPC bus includes: splitting the second message by the baseboard management controller based on the second maximum single-message transmission length to obtain a plurality of second split messages, and setting a target header indicating the position in the second message for each second split message; sequentially sending the second split message with the target header set to the second space through the basic input / output system based on the MCTP protocol link and through the LPC bus. It should be noted that the target header and the second split message can together be 32KB.
[0092] It should be noted that after the BMC splits the data to be sent into packets of appropriate sizes, it is necessary to attach a header (destination header) in front of the packet to indicate the position of the packet in the message, so as to correctly reconstruct the message according to the position during subsequent message reconstruction.
[0093] Step S36: Sequentially obtain all the second split messages from the second space through the basic input / output system, and then reconstruct the second message based on the second split messages.
[0094] In the embodiment of the present application, the step of sequentially obtaining all the second split messages from the second space through the basic input / output system and then reconstructing the second message based on the second split messages includes: sequentially obtaining all the second split messages from the second space through the basic input / output system, and then reconstructing the second message based on the second split messages and the destination header. The destination header is used to indicate the position of the split message in the total message.
[0095] In the embodiment of the present application, the step of sequentially obtaining all the second split messages from the second space through the basic input / output system and then reconstructing the second message based on the second split messages includes: setting the first KCS register to a first value and setting the second KCS register to a fourth value; when the basic input / output system reads that the first KCS register is set to the first value and the second KCS register is set to the fourth value, obtaining any one of the second split messages from the second space; setting the first KCS register to a third value and setting the second KCS register to a second value; when the basic input / output system reads that the first KCS register is set to the third value and the second KCS register is set to the second value, setting the first KCS register to a fifth value to indicate the completion of message transmission, and jumping to the step of setting the first KCS register to the first value and setting the second KCS register to the fourth value, until all the second split messages are obtained from the second space through the basic input / output system, and then reconstructing the second message based on the second split messages.
[0096] It should be noted that as Figure 7As shown in the figure, it is the process of sending single-packet data from the baseboard management control system to the basic input / output system. When the BMC has a message to send to the BIOS, the BMC reads the configuration information to determine the location in the LPC space where the message data is stored and the maximum length of data that can be written each time. After that, the BMC cuts the data to be sent into packets of appropriate sizes, and then it is necessary to perform single-packet data sending. The BMC writes the packet to the location specified by the configuration information, sets the value of the first KCS register to 0xC1, and sets the value of the second KCS register to 0x01 to notify the BIOS to receive the packet. When the BIOS detects that the value of the first KCS register is set to 0xC1 and the value of the second KCS register is set to 0x01, it reads the data in the packet at the specified location, parses the data in the packet, and then sets the value of the first KCS register to 0xC2 and the value of the second KCS register to 0x02. When the BMC detects that the value of the first KCS register is set to 0xC2 and the value of the second KCS register is set to 0x02, it indicates that the data has been read, and then it sets the value of the first KCS register to 0xC0 to perform the next single-packet sending until all the packets have been sent. At this time, the BIOS side will reorganize the data in the packets to obtain the complete second message.
[0097] It can be seen that this application splits the second message based on the second maximum single-message transmission length, controls the process through the KCS register, and transmits the second message from the baseboard management controller to the input / output system based on the second space and the LPC bus. Among them, the LPC space has a large space range and can support a large single-message transmission length; in addition, the transmission rate of the LPC bus corresponding to the MCTP protocol is relatively fast; therefore, the large single-message transmission length and the fast transmission rate improve the message transmission efficiency between the baseboard management controller and the basic input / output system; in addition, controlling the transmission process through KCS can improve the transmission accuracy.
[0098] In summary, this application implements the MCTP protocol stack on the OpenPOWER platform, including the handshake process for link establishment and the process of unpacking and repackaging during transmission; the implementation method of the MCTP protocol stack that uses the KCS to control the process and the LPC bus to transmit data; because of the MCTP protocol stack, a more advanced PLDM protocol can be used for out-of-band management, the length of a single message is not limited, and the message transmission rate is faster than that of ipmi implementation; in addition, separating the physical layer (KCS + LPC), the transport layer (MCTP), and the protocol layer (PLDM) facilitates hierarchical expansion.
[0099] See Figure 8 As shown in the figure, the embodiment of this application discloses a message transmission device based on the MCTP protocol, including:
[0100] A link establishment module 11, configured to establish an MCTP protocol link between a baseboard management controller and a basic input / output system based on the LPC space;
[0101] A message transmission module 12, configured to perform message transmission between the baseboard management controller and the basic input / output system based on the MCTP protocol link and the LPC space and through an LPC bus.
[0102] Wherein, for the more specific working processes of the above-mentioned respective modules, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.
[0103] It can be seen that this application establishes an MCTP protocol link between a baseboard management controller and a basic input / output system based on the LPC space; and performs message transmission between the baseboard management controller and the basic input / output system based on the MCTP protocol link and the LPC space and through an LPC bus. Thus, this application realizes data transmission between a baseboard management controller and a basic input / output system by establishing an MCTP protocol link. Among them, the LPC space has a relatively large space range and can support a relatively large single-message transmission length; in addition, the transmission rate of the LPC bus corresponding to the MCTP protocol is relatively fast; therefore, the relatively large single-message transmission length and the relatively fast transmission rate improve the message transmission efficiency between the baseboard management controller and the basic input / output system.
[0104] Furthermore, an embodiment of this application further provides an electronic device, Figure 9 which is a structural diagram of an electronic device 20 shown according to an exemplary embodiment. The content in the figure should not be regarded as any limitation on the scope of use of this application.
[0105] Figure 9 This is a schematic structural diagram of an electronic device 20 provided by an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, an input / output interface 24, a communication interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps of the message transmission method based on the MCTP protocol disclosed in any of the foregoing embodiments.
[0106] In this embodiment, the power supply 23 is used to provide operating voltages for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and specific limitations are not imposed on it here; the input / output interface 24 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and specific limitations are not imposed on it here.
[0107] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, an optical disk, etc. The memory 22 can include a random access memory as the operating memory and a non-volatile memory for storage purposes of external memory. The storage resources thereon include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0108] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20 on the source host, and the operating system 221 can be Windows, Unix, Linux, etc. The computer program 222 can further include a computer program capable of completing other specific tasks in addition to the computer program capable of implementing the message transmission method based on the MCTP protocol executed by the electronic device 20 disclosed in any of the foregoing embodiments.
[0109] In this embodiment, the input / output interface 24 can specifically include, but is not limited to, a USB interface, a hard disk reading interface, a serial interface, a voice input interface, a fingerprint input interface, etc.
[0110] Furthermore, an embodiment of this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the foregoing disclosed message transmission method based on the MCTP protocol.
[0111] For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.
[0112] The computer-readable storage medium mentioned here includes a random access memory (Random Access Memory, RAM), memory, read-only memory (Read-Only Memory, ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, magnetic disks, or optical disks or any other form of storage medium well-known in the technical field. Among them, when the computer program is executed by a processor, it implements the foregoing message transmission method based on the MCTP protocol. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.
[0113] In this specification, the various embodiments are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the apparatus disclosed in the embodiments, since it corresponds to the message transmission method based on the MCTP protocol disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.
[0114] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0115] The steps of the algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium well-known in the technical field.
[0116] Finally, it should also be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0117] The above has introduced in detail a message transmission method, apparatus, device and medium based on the MCTP protocol provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A message transmission method based on the MCTP protocol, characterized in that, it includes: Establish an MCTP protocol link between the baseboard management controller and the basic input / output system based on the LPC space; Based on the MCTP protocol link and the LPC space, and perform message transmission between the baseboard management controller and the basic input / output system through the LPC bus; Among them, the establishing of the MCTP protocol link between the baseboard management controller and the basic input / output system based on the LPC space includes: Write the first configuration information corresponding to the baseboard management controller into the configuration space in the LPC space through the baseboard management controller; the first configuration information includes the first space allocated for the baseboard management controller in the LPC space and the first maximum single-message transmission length corresponding to the first space; Obtain the first configuration information from the configuration space through the basic input / output system, and write the second configuration information corresponding to the basic input / output system into the configuration space; the second configuration information includes the second space allocated for the basic input / output system in the LPC space and the second maximum single-message transmission length corresponding to the second space; Obtain the second configuration information from the configuration space through the baseboard management controller to establish an MCTP protocol link between the baseboard management controller and the basic input / output system; Among them, the performing of the message transmission between the baseboard management controller and the basic input / output system based on the MCTP protocol link and the LPC space and through the LPC bus includes: When the basic input / output system sends a first message to the baseboard management controller, determine the first space in the LPC space where the first message is stored based on the first configuration information through the basic input / output system, and determine the first maximum single-message transmission length; Split the first message into several first split messages based on the first maximum single-message transmission length through the basic input / output system, and then sequentially send the first split messages to the first space through the basic input / output system based on the MCTP protocol link and through the LPC bus; Obtain all the first split messages from the first space in sequence through the baseboard management controller, and then reconstruct the first message based on the first split messages.
2. The message transmission method based on the MCTP protocol according to claim 1, characterized in that, The obtaining of all the first split messages from the first space in sequence through the baseboard management controller and then reconstructing the first message based on the first split messages includes: Set the first KCS register to a first value, and set the second KCS register to a second value; When the baseboard management controller reads that the first KCS register is set to the first value and the second KCS register is set to the second value, obtain all the first split messages from any of the first spaces. Set the first KCS register to a third value and set the second KCS register to a fourth value; When the basic input / output system reads that the first KCS register is set to the third value and the second KCS register is set to the fourth value, set the first KCS register to a fifth value to indicate that the message transmission is completed, and jump to the step of setting the first KCS register to a first value and setting the second KCS register to a second value, until all the first split messages are obtained from the first space by the baseboard management controller, and then reconstruct the first message based on the first split messages.
3. The message transmission method based on the MCTP protocol according to claim 1, characterized in that linking the MCTP protocol and the LPC space, and performing message transmission between the baseboard management controller and the basic input / output system through the LPC bus, including: When the baseboard management controller sends a second message to the basic input / output system, determine, by the baseboard management controller based on the second configuration information, the second space in the LPC space where the second message is stored, and determine the second maximum single message transmission length; Split the second message into a plurality of second split messages by the baseboard management controller based on the second maximum single message transmission length, and then sequentially send the second split messages to the second space through the basic input / output system based on the MCTP protocol link and through the LPC bus; Sequentially obtain all the second split messages from the second space by the basic input / output system, and then reconstruct the second message based on the second split messages.
4. The message transmission method based on the MCTP protocol according to claim 3, characterized in that the sequentially obtaining all the second split messages from the second space by the basic input / output system and then reconstructing the second message based on the second split messages includes: Set the first KCS register to a first value and set the second KCS register to a fourth value; When the basic input / output system reads that the first KCS register is set to the first value and the second KCS register is set to the fourth value, obtain any one of the second split messages from the second space; Set the first KCS register to a third value and set the second KCS register to a second value; When it is read by the basic input / output system that the first KCS register is set to the third value and the second KCS register is set to the second value, the first KCS register is set to the fifth value to indicate the completion of message transmission, and it jumps to the step of setting the first KCS register to the first value and setting the second KCS register to the fourth value, until all the second split messages are obtained from the second space by the basic input / output system, and then the second message is reorganized based on the second split messages.
5. The message transmission method based on the MCTP protocol according to claim 3, wherein, the splitting of the second message by the baseboard management controller based on the second maximum single message transmission length to obtain a plurality of second split messages, and then the basic input / output system links based on the MCTP protocol, and the second split messages are sequentially sent to the second space through the LPC bus, includes: splitting the second message by the baseboard management controller based on the second maximum single message transmission length to obtain a plurality of second split messages, and setting a target header indicating the position in the second message for each of the second split messages; linking by the basic input / output system based on the MCTP protocol, and sequentially sending the second split messages with the target header to the second space through the LPC bus; Correspondingly, the obtaining of all the second split messages from the second space by the basic input / output system in sequence, and then reorganizing the second message based on the second split messages, includes: obtaining all the second split messages from the second space by the basic input / output system in sequence, and then reorganizing the second message based on the second split messages and the target header.
6. A message transmission device based on the MCTP protocol, wherein, the message transmission device based on the MCTP protocol is used to implement the message transmission method based on the MCTP protocol according to any one of claims 1 to 5, and the message transmission device based on the MCTP protocol includes: a link establishment module, configured to establish an MCTP protocol link between the baseboard management controller and the basic input / output system based on the LPC space; a message transmission module, configured to perform message transmission between the baseboard management controller and the basic input / output system based on the MCTP protocol link and the LPC space, and through the LPC bus.
7. An electronic device, wherein, it includes a processor and a memory; wherein, when the processor executes the computer program stored in the memory, it implements the message transmission method based on the MCTP protocol according to any one of claims 1 to 5.
8. A computer-readable storage medium, wherein, it is used to store a computer program; wherein, when the computer program is executed by a processor, it implements the message transmission method based on the MCTP protocol according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method for monitoring network card equipment, baseboard management controller and network card equipment
CN110958132A
Equipment management method, equipment and device based on MCTP protocol, and medium
CN111352889A