Switch firmware upgrading method and device based on RDMA network
By using RDMA network reliable connection RC packets to replace traditional SMP-type UD packets in IB switches, efficient transmission of firmware upgrades is achieved, and problems of low transmission efficiency and difficult software implementation in traditional methods are solved, and firmware upgrades are improved efficiency and speed.
Patent Information
- Application Number
- CN202410956249.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-08
AI Technical Summary
The firmware upgrade method of traditional IB switches relies on unreliable SMP-type UD packets, resulting in low transmission efficiency and high software implementation difficulty, and large intervals of response packets, which extends transmission time.
Using reliable connection of RC messages based on RDMA network, by establishing an RC connection between the host side and the switch, the firmware update file is fragmented according to the maximum transmission unit of the message, and transmitted to the switch memory space in the form of RDMA messages to complete Write to flash memory after verification.
It improves the transmission efficiency of firmware upgrades, faster hardware execution speed, shortens transmission time, and reduces the difficulty of software packet loss detection and retransmission implementation.
Smart Images

Figure CN118921273A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of firmware upgrade, and in particular to a switch firmware upgrade method and device based on an RDMA network. Background Art
[0002] The IB switch runs a firmware program inside, so there is a need to upgrade the firmware program. The common upgrade method is to perform in-band upgrades through the IB network. The in-band upgrade of a traditional IB switch uses SMP-type UD messages to transfer the firmware from the host to the switch. The firmware program running in the switch receives the new firmware and writes it into the flash memory FLASH to complete the switch firmware upgrade.
[0003] For the above-mentioned SMP type UD message, since the UD message is an unreliable message, the packet loss during transmission requires software identification and retransmission, which is difficult to implement in software. The UD message size is fixed at 256 bytes, of which only 64 bytes are valid data, and the transmission efficiency is low. In addition, SMP needs to send response messages of 256 bytes one by one, and the interval between two valid messages is large, which prolongs the transmission time. Summary of the invention
[0004] The purpose of this application is to provide a switch firmware upgrade method and device based on an RDMA network, aiming to improve the firmware upgrade transmission efficiency of the switch.
[0005] According to a first aspect of the present application, a switch firmware upgrade method based on an RDMA network is provided, comprising:
[0006] Establishing an RC connection for RC message transmission between a host end and a switch in an RDMA network, and initializing a memory space for firmware upgrade in the switch;
[0007] Divide the firmware update file into a plurality of fragments according to the maximum transmission unit of the message, and transmit the plurality of fragments in sequence to the memory space of the switch in the form of RDMA messages through the RC connection by the host end;
[0008] When all the slices are transmitted, the switch verifies and authenticates all the slices. If the verification and authentication succeed, the firmware update file is written into the flash memory to complete the switch firmware upgrade.
[0009] Preferably, dividing the firmware update file into multiple fragments according to the message maximum transmission unit further includes:
[0010] The host end includes a firmware upgrade tool, and the RC message transmission channel with the switch is created by the firmware upgrade tool to establish the RC connection.
[0011] Preferably, dividing the firmware update file into multiple fragments according to the message maximum transmission unit further includes:
[0012] A SEND transaction is initiated through the firmware upgrade tool, and the firmware update file is segmented according to the message maximum transmission unit through the RC message transmission channel.
[0013] Preferably, the transmitting the plurality of slices in sequence to the memory space of the switch in the form of RDMA messages further comprises:
[0014] Transmitting the current fragment to the memory space of the switch through the RC connection, and waiting for the RC response message of the switch;
[0015] When the switch returns the RC response message to the host, the next fragment is transmitted through the RC connection until all fragments are transmitted.
[0016] Preferably, the verification and authentication of all shards further includes:
[0017] The integrity and legitimacy of all fragments are checked and authenticated. If the integrity check and legitimacy check fail, all fragments are retransmitted.
[0018] According to a second aspect of the present application, a switch firmware upgrade device based on an RDMA network is provided, comprising:
[0019] A connection unit, used to establish an RC connection for RC message transmission between a host end and a switch in an RDMA network, and initialize a memory space for firmware upgrade in the switch;
[0020] A transmission unit, used to divide the firmware update file into a plurality of fragments according to the maximum transmission unit of the message, and the host side sequentially transmits the plurality of fragments to the memory space of the switch in the form of RDMA messages through the RC connection;
[0021] The upgrade unit is used to verify and authenticate all the slices on the switch after all the slices are transmitted. If the verification and authentication are successful, the firmware update file is written into the flash memory to complete the switch firmware upgrade.
[0022] Compared with the related art, the technical solution of this application has the following advantages:
[0023] Since the hardware of the RDMA network supports RC messages, there is no need to change the hardware, and the software does not need to implement packet loss detection and retransmission. The hardware execution speed is faster than the software. Since the maximum valid data length of the RC message can reach 4KB, the transmission efficiency can be improved. The response message of the RC message is only 24B, and the direct interval between two valid data messages is small, thus shortening the total transmission time.
[0024] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 The flowchart of the switch firmware upgrade method based on the RDMA network according to the exemplary embodiment of the present application.
[0027] Figure 2 It is a signaling diagram of a switch firmware upgrade process according to an exemplary embodiment of the present application.
[0028] Figure 3 is a schematic diagram of an RC data transmission mechanism according to an exemplary embodiment of the present application.
[0029] Figure 4 It is a schematic diagram of CM message transmission according to an exemplary embodiment of the present application.
[0030] Figure 5 It is a schematic diagram of RDMA message transmission according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0032] Based on the above analysis, this application proposes a firmware upgrade method and device based on an RDMA (remote direct memory access) network, using RC (Reliable Connection) messages to replace the unreliable UD messages of the SMP type used by traditional IB switches to transmit new firmware. RC messages are reliable messages that define packet loss detection and retransmission mechanisms at the protocol level.
[0033] See also Figure 1 The switch firmware upgrade method based on the RDMA network provided in the present application includes:
[0034] Step 101: Establish an RC connection for RC message transmission between a host and a switch in an RDMA network, and initialize a memory space for firmware upgrade in the switch.
[0035] Specifically, see Figure 2 The firmware upgrade tool on the host HOST creates an RC message transmission channel with the switch. The switch upgrade program allocates memory space for receiving the new firmware.
[0036] The RC data transmission between two IB nodes is ensured to be received correctly by the receiving end due to the response mechanism defined by the protocol layer. Figure 3 As shown in the figure, during normal transmission, each REQ message will return an Ack response message. When the receiving end detects an error, such as a bit error during the transmission of the message content, it will reply with a Nak message, and the sending end will resend the message after receiving it. When the waiting time for the response times out, such as the message is discarded by the device in the transmission path, the sending end does not receive the Ack / Nak message within a certain period of time, and will resend the message.
[0037] When the RC transmission channel is established, press Figure 4 The process exchanges the QP, PKEY and other information required by the RC transmission channel. After the interaction is completed, both parties will maintain the connection status respectively, that is, the link establishment is completed, and then RDMA messages can be sent on the new QPn (n>=2).
[0038] In a preferred embodiment, communication management (CM) is used to establish RC / UC / RD transmission channels. CM messages are transmitted based on the queue pair QP1 of the general service. CM is a client / server model, where the connection establishment is actively initiated by the client and the server passively accepts the request. Among them, QP1 is used to send and receive management messages of other management, which are also called general services.
[0039] Step 102: Divide the firmware update file into multiple slices according to the message maximum transmission unit, and transmit the multiple slices in sequence to the memory space of the switch in the form of RDMA messages through the RC connection by the host end.
[0040] The firmware upgrade tool of the host HOST initiates a SEND transaction, and through the RC message transmission channel, the new firmware is fragmented according to PMTU (message maximum transmission unit) and transmitted to the switch memory in sequence. For details, see Figure 2 , the host channel adapter HCA transmits the current fragment to the memory space of the switch through the RC connection, and waits for the RC response message of the switch; when the switch returns the RC response message to the host end, the next fragment is transmitted through the RC connection until all fragments are transmitted.
[0041] Step 103: After all the slices are transmitted, all the slices are verified and authenticated on the switch. If the verification and authentication are successful, the firmware update file is written into the flash memory to complete the switch firmware upgrade.
[0042] When all the fragments are transmitted, the switch performs integrity and legality checks and authentication on the new firmware. After the check and authentication pass, it is written into FLASH to complete the switch firmware upgrade function. If the integrity check and legality check fail, all the fragments are retransmitted.
[0043] According to an optional embodiment, Figure 5 As shown, after the firmware update file is written into the switch FLASH, the host channel adapter HCA sends an RDMA read message to poll for update results.
[0044] It can be seen that the switch firmware upgrade method based on the RDMA network proposed in this application has the following advantages compared with the related technologies:
[0045] Since the hardware of the RDMA network supports RC messages, there is no need to change the hardware, and the software does not need to implement packet loss detection and retransmission. The hardware execution speed is faster than the software. Since the maximum valid data length of the RC message can reach 4KB, the transmission efficiency can be improved. The response message of the RC message is only 24B, and the direct interval between two valid data messages is small, thus shortening the total transmission time.
[0046] Accordingly, the present application provides a switch firmware upgrade device based on an RDMA network in a second aspect, comprising:
[0047] A connection unit, used to establish an RC connection for RC message transmission between the host end and the switch, and initialize a memory space for firmware upgrade in the switch;
[0048] A transmission unit, used to divide the firmware update file into a plurality of fragments according to the maximum transmission unit of the message, and the host side sequentially transmits the plurality of fragments to the memory space of the switch in the form of RDMA messages through the RC connection;
[0049] The upgrade unit is used to verify and authenticate all the slices on the switch after all the slices are transmitted. If the verification and authentication are successful, the firmware update file is written into the flash memory to complete the switch firmware upgrade.
[0050] The above-mentioned device can be implemented by the switch firmware upgrade method based on the RDMA network provided by the embodiment of the above-mentioned first aspect. The specific implementation method can refer to the description in the embodiment of the first aspect, which will not be repeated here.
[0051] It is understandable that those skilled in the art can also make easily conceivable combinations and adjustments to the structural features of the above multiple embodiments according to usage requirements, and the concept of the present application should not be limited to the specific details of the above examples.
[0052] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A switch firmware upgrade method based on RDMA network, characterized in that: include: Establishing an RC connection for RC message transmission between a host end and a switch in an RDMA network, and initializing a memory space for firmware upgrade in the switch; Divide the firmware update file into a plurality of fragments according to the maximum transmission unit of the message, and transmit the plurality of fragments in sequence to the memory space of the switch in the form of RDMA messages through the RC connection by the host end; When all the slices are transmitted, the switch verifies and authenticates all the slices. If the verification and authentication succeed, the firmware update file is written into the flash memory to complete the switch firmware upgrade.
2. The switch firmware upgrade method based on RDMA network according to claim 1, characterized in that: The step of dividing the firmware update file into a plurality of fragments according to the message maximum transmission unit further comprises: The host end includes a firmware upgrade tool, and the RC message transmission channel with the switch is created by the firmware upgrade tool to establish the RC connection.
3. The switch firmware upgrade method based on RDMA network according to claim 2, characterized in that: The step of dividing the firmware update file into a plurality of fragments according to the message maximum transmission unit further comprises: A SEND transaction is initiated through the firmware upgrade tool, and the firmware update file is segmented according to the message maximum transmission unit through the RC message transmission channel.
4. The switch firmware upgrade method based on RDMA network according to claim 1, characterized in that: The transmitting the plurality of slices in sequence to the memory space of the switch in the form of RDMA messages further includes: Transmitting the current fragment to the memory space of the switch through the RC connection, and waiting for the RC response message of the switch; When the switch returns the RC response message to the host, the next fragment is transmitted through the RC connection until all fragments are transmitted.
5. The switch firmware upgrade method based on RDMA network according to claim 1, characterized in that: The verification and authentication of all the slices further includes: The integrity and legitimacy of all fragments are checked and authenticated. If the integrity check and legitimacy check fail, all fragments are retransmitted.
6. A switch firmware upgrade device based on RDMA network, characterized in that: include: A connection unit, used to establish an RC connection for RC message transmission between a host end and a switch in an RDMA network, and initialize a memory space for firmware upgrade in the switch; A transmission unit, used to divide the firmware update file into a plurality of fragments according to the maximum transmission unit of the message, and the host side sequentially transmits the plurality of fragments to the memory space of the switch in the form of RDMA messages through the RC connection; The upgrade unit is used to verify and authenticate all the slices on the switch after all the slices are transmitted. If the verification and authentication are successful, the firmware update file is written into the flash memory to complete the switch firmware upgrade.
7. The switch firmware upgrade device based on RDMA network according to claim 6, characterized in that: The step of dividing the firmware update file into a plurality of fragments according to the message maximum transmission unit further comprises: The host end includes a firmware upgrade tool, and the RC message transmission channel with the switch is created by the firmware upgrade tool to establish the RC connection.
8. The switch firmware upgrade device based on RDMA network according to claim 7, characterized in that: The step of dividing the firmware update file into a plurality of fragments according to the message maximum transmission unit further comprises: A SEND transaction is initiated through the firmware upgrade tool, and the firmware update file is segmented according to the message maximum transmission unit through the RC message transmission channel.
9. The switch firmware upgrade device based on RDMA network according to claim 6, characterized in that: The transmitting the plurality of slices in sequence to the memory space of the switch in the form of RDMA messages further includes: Transmitting the current fragment to the memory space of the switch through the RC connection, and waiting for the RC response message of the switch; When the switch returns the RC response message to the host, the next fragment is transmitted through the RC connection until all fragments are transmitted.
10. The switch firmware upgrade device based on RDMA network according to claim 6, characterized in that: The verification and authentication of all the slices further includes: The integrity and legitimacy of all fragments are checked and authenticated. If the integrity check and legitimacy check fail, all fragments are retransmitted.
Citation Information
Patent Citations
Database all-in-one machine capable of realizing high-speed storage
CN103873559A
Network tunneling-based communication control system
KR1020220165619A
Reliable, out-of-order transmission of packets
US20170187496A1
Secure updating of computing system firmware
US20190325139A1
