Network card firmware upgrade method, device, electronic device and storage medium
Through BMC out-of-band parallel upgrade of BF3 network card firmware, the problem of out-of-band serial upgrade is solved, and shorter upgrade time and higher efficiency are achieved.
Patent Information
- Application Number
- CN202510363905.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-03-26
AI Technical Summary
The firmware of the network card device with external serial upgrade takes a long time, affecting the user experience.
Through BMC as an out-of-band processor, a collection of devices that support the target network card firmware is determined, and multiple network card devices are upgraded in parallel, and the upgrade time is shortened using parallel upgrade technology.
It reduces the time-consuming and time-consuming of firmware upgrades in network card equipment, improves upgrade efficiency, and reduces the impact on system business.
Smart Images

Figure CN119892617B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method, device, electronic device, and storage medium for upgrading network card firmware. Background Art
[0002] A server is a high-performance computer in a network environment that provides storage and processing services. In related technologies, the firmware upgrade of network card devices on a server depends on tools on the server operating system. Due to the particularity of some types of network card devices, their firmware is often upgraded through out-of-band upgrade.
[0003] However, in related technologies, the firmware upgrade of some types of network card devices through out-of-band is often in a serial manner. Since the number of network card devices in a server is relatively large, this method results in a long time-consuming firmware upgrade of network card devices. Summary of the Invention
[0004] This application provides a method, device, electronic device, and storage medium for upgrading network card firmware to at least solve the problem that the firmware upgrade of network card devices takes a long time due to out-of-band serial upgrade of network card devices in related technologies.
[0005] This application provides a method for upgrading network card firmware, which is applied to an out-of-band processor and includes:
[0006] Obtain a target network card firmware;
[0007] Based on the target network card firmware, determine at least one target network card device that supports upgrading using the target network card firmware, and obtain a target network card device set corresponding to the target network card firmware;
[0008] Receive network card upgrade requirement information input by a user;
[0009] In the case that any network card device to be upgraded characterized by the network card upgrade requirement information belongs to the target network card device set, use the network card device to be upgraded as a target network card device to be upgraded;
[0010] Based on the target network card firmware, upgrade the network card firmware in multiple target network card devices to be upgraded in parallel.
[0011] This application also provides a device for upgrading network card firmware, which is applied to an out-of-band processor and includes:
[0012] An obtaining module, configured to obtain a target network card firmware;
[0013] A first determination module, configured to determine at least one target network card device that supports upgrading using the target network card firmware based on the target network card firmware, and obtain a target network card device set corresponding to the target network card firmware;
[0014] A receiving module, configured to receive the network card upgrade requirement information input by a user;
[0015] A second determination module, configured to, when any network card device to be upgraded characterized by the network card upgrade requirement information belongs to the target network card device set, use the network card device to be upgraded as a target network card device to be upgraded;
[0016] An upgrade module, configured to upgrade the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
[0017] This application further provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above network card firmware upgrade methods when executing the computer program.
[0018] This application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program implements the steps of any of the above network card firmware upgrade methods when executed by a processor.
[0019] This application further provides a computer program product, including a computer program, and the computer program implements the steps of any of the above network card firmware upgrade methods when executed by a processor.
[0020] Through this application, since the target network card device set that supports upgrading using the target network card firmware is screened out from the server according to the target network card firmware, and multiple target network card devices to be upgraded that belong to the target network card device set are determined from the network card devices to be upgraded according to the network card upgrade requirement information characterized by the user input, and the network card firmware in multiple target network card devices to be upgraded is upgraded in parallel according to the target network card firmware. Compared with the serial upgrade method of network card firmware in the related art, parallel processing makes full use of system resources and can complete the firmware upgrade of multiple network cards in a shorter time. Therefore, the technical problem of long time-consuming for out-of-band serial upgrade of network card device firmware can be solved, and the technical effects of reducing the time-consuming for firmware upgrade of network card devices and improving the efficiency of network card firmware upgrade are achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To more clearly illustrate the embodiments of this application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of this application, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0022] Figure 1 FIG. is a schematic structural diagram of a network card firmware upgrade system provided by an embodiment of this application;
[0023] Figure 2Topology diagram for firmware parallel upgrade of BF3 network card by BMC out-of-band in the embodiments of this application;
[0024] Figure 3 Schematic flowchart of a network card firmware upgrade method provided in the embodiments of this application;
[0025] Figure 4 Schematic flowchart of another network card firmware upgrade method provided in the embodiments of this application;
[0026] Figure 5 Schematic flowchart of the PLDM device discovery thread provided in the embodiments of this application;
[0027] Figure 6 Schematic flowchart of parallel upgrade of network card firmware using the firmware upgrade start function in the embodiments of this application;
[0028] Figure 7 Schematic flowchart of updating the first network card device list using the UpdateEidList() function in the embodiments of this application;
[0029] Figure 8 Schematic flowchart of enumerating target network card devices that can be upgraded using the image.pldm firmware package from the first network card devices using the firmware upgrade device discovery function in the embodiments of this application;
[0030] Figure 9 Schematic flowchart of all firmware upgrade thread status check threads provided in the embodiments of this application;
[0031] Figure 10 Schematic flowchart of the timing thread provided in the embodiments of this application;
[0032] Figure 11 Schematic flowchart of the log record thread provided in the embodiments of this application;
[0033] Figure 12 Structure block diagram of a network card firmware upgrade device provided in the embodiments of this application;
[0034] Figure 13 Hardware structure schematic diagram of an electronic device provided in the embodiments of this application. Detailed implementation manners
[0035] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
[0036] It should be noted that in the description of this application, 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 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. The terms "first", "second", etc. in this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0037] A server is a high-performance computer in a network environment, used for storing, processing and providing network services. In the related art, a server is usually equipped with a network card component, namely a network card device. The firmware upgrade of traditional network card devices is usually completed through tools on the server operating system (Operation System, abbreviated as: OS). However, there are some types of network card devices, such as the third-generation BlueField-3 (abbreviated as: BF3) network card and the third-generation low-power BlueField-3 (abbreviated as: BF3L) network card. The firmware of the BF3 network card and the BF3L network card is divided into two parts, one part is the CX7 network card firmware, and the other part is the Advanced RISC Machine (abbreviated as: ARM) firmware. Among them, the CX7 network card is a high-performance network adapter.
[0038] Among them, the update method of the ARM firmware is special and can only be completed by means of the remote shim (abbreviated as: rshim) debugging interface on the BF3 network card. Since the functions of the rshim debugging interface are relatively powerful after it is enabled, it can not only update the firmware of the BF3 network card, but also completely control the BF3 network card. For example, it can operate and access the embedded multimedia card (abbreviated as: eMMC) or solid-state drive (abbreviated as: SSD) on the BF3 network card, and can also set the working mode of the BF3 network card. Therefore, the enabling of the rshim debugging interface can only be initiated from out-of-band and must be closed after updating the firmware of the BF3 network card.
[0039] However, the enabling operation and closing operation of the rshim debugging interface usually require restarting the server, and may even require powering off the server, which seriously affects the services running on the server and may also cause problems such as card loss and driver loss, making the firmware upgrade process of the BF3 network card on the server extremely complex.
[0040] Since the enabling operation of the rshim debugging interface makes out-of-band operations inevitable, to solve the above problems, the entire upgrade process of the firmware of the BF3 network card or BF3L network card can be migrated to out-of-band execution, so as to achieve firmware update with only one server restart, thus avoiding the complex upgrade operations caused by multiple power-on / off cycles and mixed in-band and out-of-band operations.
[0041] However, the method of upgrading the network card firmware out-of-band solves the problem of complex upgrade operations. However, upgrading the network card firmware out-of-band often upgrades the firmware of each network card in a serial manner. Since there are many network cards in the server, this serial method of upgrading the firmware in the network cards of the server takes a long time. Exemplarily, upgrading a network card firmware of 80M size takes about 20 minutes. If the server is configured with 8 network cards, it takes 160 minutes to upgrade the firmware of each network card in a serial manner, which is time-consuming and greatly reduces the user experience.
[0042] In view of the above problems, the embodiments of the present application provide a method, device, electronic device and storage medium for upgrading network card firmware. The method is applied to an out-of-band processor and includes: obtaining a target network card firmware; determining at least one target network card device that supports upgrading using the target network card firmware based on the target network card firmware, to obtain a target network card device set corresponding to the target network card firmware; receiving network card upgrade requirement information input by a user; when any network card device to be upgraded characterized by the network card upgrade requirement information belongs to the target network card device set, using the network card device to be upgraded as a target network card device to be upgraded; and based on the target network card firmware, upgrading the network card firmware in multiple target network card devices to be upgraded in parallel. The method provided by the above solution uploads the latest version of the network card firmware, i.e., the target network card firmware, to the out-of-band processor. According to the target network card firmware, a target network card device set that supports upgrading using the target network card firmware is screened out from the server. According to the network card device to be upgraded characterized by the network card upgrade requirement information input by the user, multiple target network card devices to be upgraded that belong to the target network card device set are determined from the network card devices to be upgraded. According to the target network card firmware, the network card firmware in multiple target network card devices to be upgraded is upgraded in parallel, solving the technical problem of long time consumption for out-of-band serial upgrade of the firmware of network card devices and achieving the technical effect of reducing the time consumption for upgrading the firmware of network card devices.
[0043] To enable those skilled in the art of this technical field to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the network card firmware upgrade method depends, the specific application environment architecture or specific hardware architecture is described herein.
[0045] The network card firmware upgrade method, device, electronic device, and storage medium provided by the embodiments of the present application are applicable to an out-of-band processor to parallelly upgrade the network card firmware of multiple network card devices in a server through the out-of-band processor. As Figure 1 shown, it is a schematic diagram of the architecture of the network card firmware upgrade system based on the embodiments of the present application. As Figure 1 shown, the network card firmware upgrade system includes a central processing unit (CPU), memory, storage device, network card device, baseboard management controller (BMC), etc. on the server motherboard. Among them, on the server motherboard, the BMC is a small operating system independent of the server's operating system, used to monitor the overall operation of the server. It is a unique management controller of the server and is also used to perform operations such as remote management, monitoring, deployment, and restarting the server. It should be noted that in the embodiments of the present application, the network card device is taken as the BF3 network card for illustration.
[0046] Since the BMC can be started and run as long as the power is turned on, it is not affected by the server's power on and off, and is independent of the business system. Therefore, in the embodiments of the present application, by migrating the firmware upgrade process of the network card device in the server to the BMC for execution, the firmware of the network card device in the server can be upgraded in parallel out of band. That is to say, the BMC can be used as an out-of-band processor to parallelly upgrade the firmware of multiple network card devices in the server.
[0047] Figure 2 It is a topology diagram for the BMC to parallelly upgrade the firmware of the BF3 network card out of band provided by the embodiments of the present application. As Figure 2 shown, the BMC sets corresponding upgrade threads (threads) for multiple BF3 network cards in the server system, where each BF3 network card corresponds to an upgrade thread. By setting corresponding upgrade threads for multiple BF3 network cards in the server system, the upgrade threads corresponding to multiple BF3 network cards are executed in parallel, so as to parallelly upgrade the firmware in multiple BF3 network cards in the server.
[0048] It can be seen that the method of parallelly upgrading the firmware of the BF3 network card out of band by the BMC solves the problem of long time consumption for serial out-of-band upgrade of the firmware of multiple network cards, and greatly shortens the time required for upgrading the firmware of the BF3 network card. Exemplarily, it takes about 160 minutes to serially upgrade 8 network cards of 80M, and the parallel upgrade shortens the time to 35 minutes, which greatly shortens the time required for upgrading the network card firmware.
[0049] The embodiments of the present application provide a network card firmware upgrade method, which is applied to an out-of-band processor. The out-of-band processor can be the above-mentioned baseboard management controller, Figure 3The flowchart of the network card firmware upgrade method provided by the embodiments of this application is as follows Figure 3 As shown, the process includes the following steps:
[0050] Step S301, obtain the target network card firmware.
[0051] Among them, the target network card firmware can be the latest version of the network card firmware of the network card device in the current server, or any upgraded version of the network card firmware of the current version of the network card device in the current server.
[0052] It should be noted that the network card devices in the server can all be BF3 network cards, or all be BF3L network cards. Of course, they can also be other types of network card devices, which are not specifically limited here. When the network card devices in the server are all BF3 network cards, the target network card firmware can be the latest version of the BF3 network card firmware.
[0053] Among them, after obtaining the target network card firmware, the target network card firmware can be uploaded to the / var / path of the BMC and renamed image.pldm.
[0054] Step S302, based on the target network card firmware, determine at least one target network card device that supports upgrading using the target network card firmware, and obtain the target network card device set corresponding to the target network card firmware.
[0055] Among them, after obtaining the target network card firmware, it is necessary to determine at least one target network card device in the server that supports upgrading using the target network card firmware, and these target network card devices form the target network card device set corresponding to the target network card firmware.
[0056] It can be understood that the target network card device set can be recorded in the form of a list, that is, the logical identifiers of each target network card device in the target network card device set are recorded in the form of a list.
[0057] Step S303, receive the network card upgrade requirement information input by the user.
[0058] Among them, the user can input the network card upgrade requirement information on the BMC interface. The network card upgrade requirement information can include the logical identifier of the network card device to be upgraded. It can be understood that the network card upgrade requirement information input by the user can represent all BF3 network cards in the server, or one or more BF3 network cards that the user wants to upgrade.
[0059] Step S304, in the case that any network card device to be upgraded represented by the network card upgrade requirement information belongs to the target network card device set, use the network card device to be upgraded as the target network card device to be upgraded.
[0060] Among them, according to the logical identifier in the network card upgrade requirement information, it is determined whether the network card device to be upgraded corresponding to any logical identifier belongs to the target network card device set. If it belongs to the target network card device set, it indicates that the network card device to be upgraded can be upgraded using the target network card firmware, and then the network card device to be upgraded is determined as the target network card device to be upgraded.
[0061] It should be noted that the logical identifier is the Endpoint ID (EID for short). In the Management Component Transport Protocol (MCTP for short), it is used to uniquely identify each MCTP endpoint in the system, and each MCTP endpoint needs to be assigned a unique EID. Among them, the EID can be dynamically assigned by a management controller (such as BMC) in the MCTP network, or can be predefined through static configuration. When the system starts, the management controller usually assigns an EID to each MCTP endpoint.
[0062] Step S305: Based on the target network card firmware, upgrade the network card firmware in multiple target network card devices to be upgraded in parallel.
[0063] Among them, in the case of obtaining multiple target network card devices to be upgraded that belong to the target network card device set among the multiple network card devices to be upgraded characterized by the network card upgrade requirement information, based on the target network card firmware, upgrade the network card firmware in multiple target network card devices to be upgraded in parallel.
[0064] The network card firmware upgrade method provided by the embodiments of this application obtains the target network card firmware, enumerates the target network card devices that support upgrading using the target network card firmware according to the target network card firmware to obtain the target network card device set of the target network card firmware, receives the network card upgrade requirement information input by the user, and when any network card device to be upgraded characterized by the network card upgrade requirement information belongs to the target network card device set, uses the network card device to be upgraded as the target network card device to be upgraded, and based on the target network card firmware, upgrades the network card firmware in multiple target network card devices to be upgraded in parallel. This out-of-band parallel upgrade method for network card firmware shortens the time for upgrading multiple network card firmwares, improves the upgrade efficiency, reduces the impact of network card firmware upgrade on system services, ensures the normal operation of services on the server, and solves the problem of long time-consuming for out-of-band serial upgrade of network card device firmware and poor user experience in related technologies.
[0065] The embodiments of this application provide a network card firmware upgrade method, which is applied to an out-of-band processor, and the out-of-band processor can be the above-mentioned baseboard management controller. Figure 4 It is a flowchart of the network card firmware upgrade method provided by the embodiments of this application, asFigure 4 As shown, the process includes the following steps:
[0066] Step S401, obtain the target network card firmware. For details, please refer to Figure 3 Step S301 of the embodiment shown, which will not be elaborated here.
[0067] Step S402, based on the target network card firmware, determine at least one target network card device that supports upgrading using the target network card firmware, and obtain the target network card device set corresponding to the target network card firmware.
[0068] Specifically, the above step S402 includes:
[0069] Step S4021, determine the first network card device in the server that supports both the platform-level data model protocol and the management component transport protocol and supports upgrading.
[0070] Among them, the platform-level data model protocol (Platform Level Data Model, abbreviated as: PLDM) is an application layer protocol, and MCTP is a transport layer protocol.
[0071] Use the PLDM device discovery (DiscoverPldmDevice) thread to discover in real time the network card devices in the server that support the PLDM over MCTP protocol, that is, the network card devices that support both the PLDM protocol and the MCTP protocol.
[0072] Figure 5 For the flow diagram of the PLDM device discovery thread of the embodiment of the present application. As Figure 5 shown, the PLDM device discovery thread includes the following steps:
[0073] 1. Enter the while(1) infinite loop to ensure that the thread keeps working and continuously repeats the subsequent process.
[0074] 2. Lock. Because the process of enumerating the first network card device will access the network card device to obtain relevant information, and the network card firmware will also interact with the network card device during the upgrade of the network card firmware. If two threads access the network card device at the same time, it will cause the failure of the network card firmware upgrade. Therefore, the process of enumerating the first network card device and the process of upgrading the network card firmware need to be mutually exclusive and cannot be carried out simultaneously, and a locking process is required.
[0075] 3. Use the UpdateEidList() function to update the EID list, that is, update the first network card device list, and the first network card device list contains the EIDs of the first network card devices.
[0076] 4. Release the lock. After updating the first network card device list, the lock needs to be released to allow other threads to access the network card device.
[0077] 5. Use the recvfrom() function to block and wait for information sent by the MCTP layer. The recvfrom() function is used to receive data from a socket. When this function is called, it works in blocking mode by default, which means that after the function is called, the execution flow of the program will pause at this step until data is sent from the specified source. In this embodiment, the specified source is the MCTP layer.
[0078] When a hot-pluggable device is inserted or removed, the MCTP layer can sense these changes and update the device list it maintains. For example, when a new network card is inserted into the system, the MCTP layer will add the network card to the device list.
[0079] When the device list of the MCTP layer changes, the MCTP layer will send corresponding messages to notify other components. At this time, the originally blocked recvfrom() function will receive these messages, and the execution flow of the program will continue downward, that is, the PLDM device discovery thread will be executed again to update the first network card device list. The PLDM layer is an application program based on the MCTP layer. When the recvfrom() receives the device list change message sent by the MCTP layer, the PLDM application layer will synchronously update the device list it maintains according to these messages. For example, if the MCTP layer adds a new device, the PLDM application layer will also add the information of this device to its own device list; if a device is removed, the PLDM application layer will also delete the information of this device accordingly.
[0080] If the device list of the MCTP layer does not change, it means that the MCTP layer will not send a device list change message. Then the recvfrom() function will remain blocked, and the program will keep waiting until new data (such as a device list change message) arrives.
[0081] Step S4022: Based on the target network card firmware, determine at least one target network card device among the first network card devices that supports upgrading using the target network card firmware.
[0082] Among them, the PLDM device discovery thread enumerates the first network card devices that support both the PLDM protocol and the MCTP protocol and support upgrading, and uses the firmware upgrade device discovery function, that is, the DiscoverFirmwareDevice() function, to enumerate the target network card devices that can be upgraded using the image.pldm firmware package from the first network card devices.
[0083] Step S403: Receive the network card upgrade requirement information input by the user. For details, please refer to Figure 3Step S303 of the illustrated embodiment will not be elaborated herein.
[0084] Step S404: When any network card device to be upgraded characterized by the network card upgrade requirement information belongs to the target network card device set, use this network card device to be upgraded as the target network card device to be upgraded.
[0085] Specifically, the above step S404 includes:
[0086] Step S4041: For any network card device to be upgraded, determine whether there is any target network card device in the target network card device set whose logical identifier is the same as that of this network card device to be upgraded.
[0087] Step S4042: If there is any target network card device in the target network card device set whose logical identifier is the same as that of this network card device to be upgraded, determine that this network card device to be upgraded belongs to the target network card device set, and use this network card device to be upgraded as the target network card device to be upgraded.
[0088] Among them, the parallel upgrade of the network card firmware is performed by using the firmware upgrade start function, that is, the StartPldmUpdate function. The input parameters of this function are the number count of network card devices to be upgraded and the list of network card devices to be upgraded. It can be understood that the input parameters of this function are the network card upgrade requirement information input by the user. The list of network card devices to be upgraded includes the logical identifiers of the network card devices to be upgraded.
[0089] Figure 6 It is a flowchart of the parallel upgrade of network card firmware provided by the embodiment of the present application using the firmware upgrade start function. As Figure 6 shown, this process includes the following steps:
[0090] 1. Before performing the parallel upgrade of the network card firmware using the firmware upgrade start function, create a log recording thread, that is, the LogPLDMMessages thread, and detach this thread. This log recording thread is used to record the upgrade execution information generated during the parallel upgrade of the network card firmware.
[0091] 2. Traverse the input parameter device list, that is, traverse the list of network card devices to be upgraded.
[0092] 3. Traverse the gFwUpdateContextList global variable. This gFwUpdateContextList global variable is a global structure array used to store the information required for the upgrade of each target network card device. This information includes the logical identifier of each target network card device, the context information required for the maintenance upgrade of each target network card device, etc. This gFwUpdateContextList global variable is also used to store the number of target network card devices.
[0093] 4. Determine whether the EID of the network card device to be upgraded currently traversed in the input parameter device list is equal to the EID of the gFwUpdateContextList. That is, determine whether the logical identifier of the network card device to be upgraded currently traversed is the same as the logical identifier of the target network card device currently traversed in the gFwUpdateContextList.
[0094] 5. If the EID of the network card device to be upgraded currently traversed is equal to the EID of the gFwUpdateContextList, that is, the logical identifier of the network card device to be upgraded currently traversed is the same as the logical identifier of the target network card device currently traversed in the gFwUpdateContextList, then it is determined that a matching device is found, the flag bit is set to 1, and the loop is exited, that is, no longer continue to traverse the logical identifiers of the remaining target network card devices in the gFwUpdateContextList. Among them, this flag bit is used to indicate whether a matching device is found. A flag bit of 1 indicates that a matching device is found, and a flag bit not equal to 1 indicates that no matching device is found.
[0095] 6. If the EID of the network card device to be upgraded currently traversed is not equal to the EID of the gFwUpdateContextList, that is, the logical identifier of the network card device to be upgraded currently traversed is not the same as the logical identifier of the target network card device currently traversed in the gFwUpdateContextList, then continue to traverse the logical identifier of the next target network card device in the gFwUpdateContextList until a matching device is found or the logical identifiers of all target network card devices in the gFwUpdateContextList are traversed.
[0096] 7. Determine whether the flag bit is 1. That is, determine whether a matching device is found.
[0097] If the flag bit is not 1, then it is determined that no matching device is found, and the upgrade process is exited. That is, if there is no logical identifier of any target network card device in the target network card device set that is the same as the logical identifier of the current network card device to be upgraded, then it is determined that the network card device to be upgraded does not belong to the target network card device set and cannot be upgraded using the target network card firmware, and an information indicating that it cannot be upgraded is returned.
[0098] 8. If the flag bit is 1, it is determined that a matching device is found, and the upgrade thread StartUpdate is created. That is to say, if the logical identifier of any target network card device in the target network card device set is the same as the logical identifier of the network card device to be upgraded, it is determined that the network card device to be upgraded belongs to the target network card device set, and the network card device to be upgraded is used as the target network card device to be upgraded, and a corresponding upgrade thread is created for the target network card device to be upgraded.
[0099] 9. Detach the thread (pthread_detach). Set the upgrade thread of each target network card device to be in a detached state so that it automatically releases resources when it ends without the need for other threads to operate. This can reduce the occupation of system resources and avoid resource leakage.
[0100] 10. Continue the next round of loop. That is, continue to traverse the next network card device to be upgraded in the list of network card devices to be upgraded until all traversals are completed. For each target network card device to be upgraded, a corresponding upgrade thread is created, and the upgrade threads of each target network card device are executed in parallel to achieve parallel upgrade of the network card firmware of multiple target network card devices.
[0101] 11. Create a thread for checking the status of all firmware upgrade threads, that is, the thread AllFdFwUpdateStatusChecker, and detach this thread. This thread is used to indicate whether all upgrade threads have ended.
[0102] Step S405, based on the target network card firmware, parallelly upgrade the network card firmware in multiple target network card devices to be upgraded.
[0103] The network card firmware upgrade method provided by the embodiment of the present application first determines the first network card devices in the server that support both the PLDM protocol and the MCTP protocol and support upgrade, and then determines the target network card devices that support using the target network card firmware for upgrade from the first network card devices, achieving the effect of accurately determining the target network card devices, avoiding unnecessary upgrade attempts for incompatible network cards, and improving system stability. By judging whether there is any target network card device in the target network card device set whose logical identifier is the same as the logical identifier of the network card device to be upgraded, it is ensured that only the network card devices that meet the user requirements and the upgrade conditions will be used as the target network card devices to be upgraded for upgrade, improving the accuracy and reliability of the upgrade operation.
[0104] In some alternative embodiments, the above step S4021 includes:
[0105] Step a1, determine the second network card devices that support the management component transport protocol from the transport layer.
[0106] Step a2, obtain the message types supported by the second network card device.
[0107] Step a3, based on the message types supported by the second network card device, determine whether the second network card device supports the platform-level data model protocol.
[0108] Step a4, if the second network card device supports the platform-level data model protocol, then determine the second network card device as a third network card device that supports both the platform-level data model protocol and the management component transfer protocol.
[0109] Step a5, determine whether the third network card device supports upgrading.
[0110] Step a6, if the third network card device supports upgrading, then determine the third network card device as the first network card device.
[0111] As described above, use the UpdateEidList() function to update the first network card device list. Figure 7 This is the flowchart of using the UpdateEidList() function to update the first network card device list provided by the embodiments of the present application. As Figure 7 shown, this process includes the following steps:
[0112] 1. Use the GetPldmEndPointInfoFromMctp() function to obtain the number of network card devices supporting the MCTP protocol and the message types supported by the network card devices supporting the MCTP protocol from the MCTP layer.
[0113] 2. According to the message types supported by the network card devices supporting the MCTP protocol, determine the network card devices that support both the MCTP protocol and the PLDM protocol, that is, the third network card devices. This step is not shown in the figure.
[0114] 3. Use the calloc() function to allocate space for storing the information of the first network card device. The information of the first network card device includes information such as the EID of the network card device and the media type.
[0115] 4. Traverse each third network card device, access the third network card device, and determine whether the third network card device supports upgrading, that is, determine whether the third network card device needs to be upgraded.
[0116] Among them, the GetPldmTypeReq() function is used to send commands to each third network card device. If the command is successfully sent to any third network card device, the global variable gEidListCount is incremented by 1, and the eid of this third network card device is assigned to the applied space, that is, gpPldmEidList[i].eid = eids. Among them, the global variable gEidListCount is used to represent the number of first network card devices, and the global structure gpPldmEidList is used to represent the EID information of the first network card devices.
[0117] If the command fails to be sent to any third network card device, the current loop is skipped and the next third network card device is continued to be accessed.
[0118] Until all third network card devices are traversed, the first network card devices are obtained.
[0119] The network card firmware upgrade method provided by the embodiments of the present application, through step-by-step screening, first determines the second network card devices that support the MCTP protocol, and then further determines whether they support the PLDM protocol, and finally obtains the third network card devices that support both protocols. After determining the third network card devices, it will also be judged whether they support the upgrade. This step can effectively avoid unnecessary upgrade attempts on network card devices that do not have the upgrade ability, reduce problems such as network card failures and system instability caused by incompatible upgrades, and improve the success rate and reliability of the upgrade operation.
[0120] In some alternative embodiments, the above step S4022 includes:
[0121] Step b1, based on the target network card firmware, determine the information of the network card devices supported by the target network card firmware.
[0122] Step b2, for any first network card device, obtain the physical identifier of the first network card device.
[0123] Step b3, determine whether the information of the network card devices supported by the target network card firmware includes the physical identifier of the first network card device.
[0124] Step b4, if the information of the network card devices supported by the target network card firmware includes the physical identifier of the first network card device, determine the first network card device as the target network card device that supports upgrading using the target network card firmware.
[0125] As described above, the DiscoverFirmwareDevice() function, that is, the firmware upgrade device discovery function, is used to enumerate the target network card devices that can be upgraded using the image.pldm firmware package from the first network card devices. Figure 8The flowchart for enumerating target network card devices that can be upgraded using the image.pldm firmware package from the first network card device provided by the embodiments of the present application is as follows Figure 8 As shown, the process includes the following steps:
[0126] 1. Use the GetLocalPldmEidByType() function to obtain the number of the first network card devices and the EID information of the first network card devices. The number of the first network card devices and the EID information of the first network card devices can be obtained from the global variable gEidListCount and the global structure gpPldmEidList of the DiscoverPldmDevice thread.
[0127] 2. Obtain the information of the firmware package image.pldm, that is, the information of the network card devices supported by the target network card firmware.
[0128] 3. Traverse the pldm devices that support upgrade, that is, traverse the list of the first network card devices.
[0129] 4. Access the device to obtain the device identifier DeviceIdentifiers, that is, access the current first network card device to obtain the device identifier of the first network card device. This device identifier is the physical identifier of the first network card device, where each network card device corresponds to a unique physical identifier.
[0130] 5. Determine whether the information obtained from the firmware package is equal to the device identifier.
[0131] 6. If they are not equal, continue to traverse the next first network card device in the list of the first network card devices.
[0132] 7. If they are equal, increment the fd_idx count by 1. This fd_idx is used to represent the number of target network card devices, and assign the information obtained by accessing the device, that is, the physical identifier, to the global structure gFwUpdateContextList[i] for the upgrade of a single network card device. The global structure gFwUpdateContextList[i] contains the EID information of the target network card device.
[0133] The network card firmware upgrade method provided by the embodiments of the present application ensures that only network card devices compatible with the firmware are marked as upgradeable devices by clarifying the information of the network card devices supported by the target network card firmware. This can avoid upgrade failures or device malfunctions caused by incompatibility.
[0134] In some alternative embodiments, the above network card firmware upgrade method further includes:
[0135] Step c1, before performing the step of determining the first network card device in the server that supports both the platform-level data model protocol and the management component transfer protocol and supports upgrade, perform a mutex lock operation on all network card devices in the server to prevent other threads from accessing all network card devices in the server concurrently.
[0136] Step c2, after determining the first network card device, perform a mutex unlock operation on all network card devices in the server to allow other threads to access all network card devices in the server.
[0137] For details, refer to Steps 2 and 4 in the aforementioned PLDM device discovery thread, which will not be elaborated here.
[0138] The network card firmware upgrade method provided by the embodiment of the present application, by performing a mutex lock operation on all network card devices in the server before determining the first network card device, can ensure that no other threads access or modify these network card devices simultaneously during this period. This effectively avoids concurrent access conflicts in a multi-threaded environment, guarantees data consistency and integrity, and improves the stability and reliability of the system.
[0139] In some optional embodiments, the above network card firmware upgrade method further includes:
[0140] Step d1, if there is no logical identifier of any target network card device in the target network card device set that is the same as the logical identifier of the network card device to be upgraded, it is determined that the network card device to be upgraded does not belong to the target network card device set and cannot be upgraded using the target network card firmware, and an information indicating inability to upgrade is returned.
[0141] For details, refer to Steps 2 to 7 in the aforementioned process of parallel upgrade of network card firmware using the firmware upgrade start function, which will not be elaborated here.
[0142] The network card firmware upgrade method provided by the embodiment of the present application, through the comparison of logical identifiers, can clearly determine whether the network card device to be upgraded belongs to the target network card device set. If the logical identifier of the network card device to be upgraded does not match any logical identifier in the target network card device set, an information indicating inability to upgrade is directly returned. This can avoid invalid upgrade operations on incompatible or irrelevant devices and prevent system anomalies or device failures caused by incorrect upgrades. By strictly verifying the logical identifiers, it is ensured that only network card devices meeting the conditions can enter the upgrade process, thereby enhancing the stability and reliability of the system.
[0143] In some optional embodiments, the above Step S405 includes:
[0144] Step e1, create a corresponding upgrade thread for each target network card device to be upgraded.
[0145] Step e2, execute the upgrade threads of multiple target network card devices to be upgraded in parallel, and upgrade the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
[0146] For details, refer to Steps 8 and 10 in the aforementioned process of parallel upgrade of network card firmware using the firmware upgrade start function, which will not be elaborated here.
[0147] The network card firmware upgrade method provided by the embodiments of the present application can significantly shorten the overall upgrade time by creating independent upgrade threads for each target network card device to be upgraded and executing the firmware upgrade of multiple target network card devices to be upgraded in parallel. Compared with the serial upgrade method, this method can make full use of the advantages of multi-core processors and greatly improve the upgrade efficiency. During the parallel upgrade process, if the firmware upgrade of a certain target network card device to be upgraded fails or encounters an exception, it will not affect the upgrade operations in other threads. This isolation mechanism enhances the fault tolerance and stability of the system.
[0148] In some optional embodiments, the above network card firmware upgrade method further includes:
[0149] Step f1, set the upgrade threads of each target network card device to be upgraded to the detached state.
[0150] For details, refer to Step 9 in the aforementioned process of parallel upgrade of network card firmware using the firmware upgrade start function, which will not be elaborated here.
[0151] The network card firmware upgrade method provided by the embodiments of the present application sets the upgrade threads of each target network card device to be upgraded to the detached state. After the detached state threads finish execution, the operating system will automatically release the resources they occupy, without the need to explicitly call the thread connection operation. This avoids memory leakage problems caused by forgetting to recycle thread resources and enhances the robustness of the program. In a multi-threaded environment, improper thread management may lead to deadlocks or other abnormal situations. By using the detached state, the dependence on thread connection operations is reduced, and the risk of thread management-related problems is lowered, thereby enhancing the stability of the program.
[0152] In some optional embodiments, the above network card firmware upgrade method further includes:
[0153] Step g1, at every first preset time period, perform an upgrade access to the target network card device to be upgraded to determine whether the network card firmware of all target network card devices to be upgraded has been completely upgraded.
[0154] Among them, the first preset time period is set by technicians and is not specifically limited here. Exemplarily, the first preset time period can be 5 seconds.
[0155] Step g2, if the network card firmware of all target network card devices to be upgraded has been completely upgraded, stop executing the step of accessing the target network card devices to be upgraded at every first preset time interval, and return the upgrade completion information.
[0156] As described above, create a thread AllFdFwUpdateStatusChecker, which is used to indicate whether all upgrade threads have ended. Specifically, Figure 9 This is the flowchart of the thread for checking the status of all firmware upgrade threads provided by the embodiments of this application. As Figure 9 shown, this process includes the following steps:
[0157] 1. Initialize the continue loop variable, that is, continueLoop, to 1.
[0158] 2. Lock to prevent the network card firmware upgrade thread and the DiscoverPldmDevice thread from accessing the network card device simultaneously.
[0159] 3. Enter the while (continueLoop) loop and assign continueLoop to 0.
[0160] 4. Traverse gFwUpdateContextList. Determine whether there is a network card device being upgraded. If there is a network card device being upgraded, assign continueLoop to 1 and continue the loop. If there is no network card device being upgraded, continueLoop is 0 and the loop exits in the next round.
[0161] 5. sleep(5). That is, let the current thread pause execution for 5 seconds and enter the sleep state, thereby releasing CPU resources and giving other threads the opportunity to obtain the execution right.
[0162] If there is a network card device being upgraded, after pausing execution for 5 seconds, return to step 3 of this process.
[0163] 6. Release the lock. It can be understood that the lock is released when there is no network card device being upgraded.
[0164] The network card firmware upgrade method provided by the embodiments of this application can monitor the upgrade status of the network card firmware in real time by performing upgrade access to the target network card device to be upgraded at intervals of a first preset time period. This periodic check mechanism ensures that the system can timely grasp the upgrade progress of all target network card devices to be upgraded, thereby improving the response speed and reliability of the system. After the network card firmware of all target network card devices to be upgraded is completely upgraded, the periodic check operation is immediately stopped, and the upgrade completion information is returned. This avoids unnecessary repeated checks, reduces the waste of system resources, and improves the overall efficiency at the same time.
[0165] In some alternative embodiments, the above network card firmware upgrade method further includes:
[0166] Step h1, if the network card firmware of any target network card device to be upgraded is not upgraded completely, continue to perform the step of performing upgrade access to the target network card device to be upgraded at intervals of a first preset time period until the network card firmware of all target network card devices to be upgraded is completely upgraded.
[0167] For details, refer to step 4 in the process of all the above firmware upgrade thread status check threads, which will not be elaborated here.
[0168] The network card firmware upgrade method provided by the embodiments of this application can ensure that no device is omitted or fails to be upgraded successfully by continuously performing periodic checks until the firmware of all target network card devices to be upgraded is completely upgraded, which guarantees the integrity and consistency of the upgrade process. If there are some target network card devices to be upgraded that are slower or encounter temporary problems (such as network latency, resource contention, etc.), this loop check mechanism can continuously track the status of these target network card devices to be upgraded until they are finally upgraded, which enhances the reliability of the entire upgrade process.
[0169] In some alternative embodiments, the above network card firmware upgrade method further includes:
[0170] Step i1, before performing the step of performing upgrade access to the target network card device to be upgraded at intervals of a first preset time period to determine whether the network card firmware of all target network card devices to be upgraded is completely upgraded, perform a mutex lock operation on all network card devices in the server to prevent other threads from performing concurrent access to all network card devices in the server.
[0171] Step i2, when the network card firmware of all target network card devices to be upgraded is completely upgraded, perform a mutex unlock operation on all network card devices in the server to allow other threads to access all network card devices in the server.
[0172] For details, refer to steps 2 and 6 in the process of the aforementioned firmware upgrade thread status check thread, which will not be elaborated here.
[0173] In the network card firmware upgrade method provided by the embodiment of the present application, by performing a mutex lock operation on all network card devices in the server before performing periodic check of the upgrade status, it can effectively prevent other threads from accessing these network card devices concurrently, avoiding data inconsistency or conflict problems caused by multiple threads operating on the same resource simultaneously. Through the mutex lock mechanism, it is ensured that only the current thread can access and modify the target network card device to be upgraded during the upgrade process, thus guaranteeing data consistency and integrity. This protection mechanism is particularly important for complex operations in a multi-threaded environment.
[0174] In some optional embodiments, the above network card firmware upgrade method further includes:
[0175] Step j1, in the case of receiving network card device change information sent by the transport layer, based on the network card device change information, perform the step of determining at least one target network card device that supports upgrading using the target network card firmware, so as to update the target network card device set corresponding to the target network card firmware.
[0176] For details, refer to step 5 in the process of the aforementioned PLDM device discovery thread, which will not be elaborated here.
[0177] In the network card firmware upgrade method provided by the embodiment of the present application, by receiving network card device change information sent by the transport layer, the system can perceive the status changes of network card devices in the network in real time. This dynamic adaptation ability ensures that the upgrade process always operates based on the latest device information. Based on the network card device change information and the target network card firmware, determining the device set that supports upgrading using this firmware, this process ensures that only eligible network card devices are included in the upgrade scope, avoiding misoperations on incompatible devices and improving the accuracy of the upgrade.
[0178] In some optional embodiments, the above network card firmware upgrade method further includes:
[0179] Step k1, at every second preset time interval, for any target network card device to be upgraded, determine whether the network card firmware in the target network card device to be upgraded has been upgraded.
[0180] Wherein, the second preset time interval can be set by technical personnel and is not specifically limited here. Exemplarily, the second preset time interval can be 1 second.
[0181] Step k2, if the network card firmware in the target network card device to be upgraded has not been upgraded, determine whether the upgrade time of the network card firmware in the target network card device to be upgraded exceeds the preset upgrade time threshold.
[0182] Step k3, if the upgrade time of the network card firmware in the target network card device to be upgraded exceeds the preset upgrade time threshold, stop continuing to upgrade the network card firmware in the target network card device to be upgraded, and determine that the upgrade of the network card firmware in the target network card device to be upgraded fails.
[0183] Among them, a timing thread will be created in the upgrade thread of each target network card device to be upgraded. The timing thread creates a timer to set a timeout for each upgrade task, so as to set a timeout mechanism for each upgrade task and avoid affecting the overall progress due to the firmware upgrade of a single network card device getting stuck.
[0184] Figure 10 It is a schematic flowchart of the timing thread provided by the embodiment of the present application. As Figure 10 shown, this process includes the following steps:
[0185] 1. Assign the initial value 0 to the variable time.
[0186] 2. Enter the while(1) infinite loop to determine whether the value of time is equal to the threshold. Among them, the threshold is the preset upgrade time threshold.
[0187] If the value of time is equal to the threshold, it means that the timing time has arrived. Then determine whether the upgrade thread exists. If it exists, cancel the upgrade thread and return 0. It can be understood that whether the upgrade thread exists, that is, whether the network card firmware is being upgraded.
[0188] 3. If the value of time is not equal to the threshold, then determine whether the upgrade thread exists. If the upgrade thread does not exist, it means that the upgrade is over, and directly return 0.
[0189] If the upgrade thread exists, then sleep 1. That is, let the current thread pause execution for 1 second and enter the sleep state. After the value of time is incremented by 1, continue the loop.
[0190] It can be understood that the order of the processes of the foregoing steps k1 to k3 is slightly different from the process of the timing thread, but the achieved effects are the same. That is, the effects achieved by the foregoing steps k1 to k3 can be achieved using this timing thread.
[0191] The network card firmware upgrade method provided by the embodiments of the present application can track the upgrade status of each target network card device to be upgraded in real time by checking any target network card device to be upgraded at intervals of a second preset time period. This mechanism ensures that the system can promptly detect the target network card devices to be upgraded that have not completed the upgrade, thereby improving the transparency and controllability of the overall upgrade process. If the upgrade time of the network card firmware in the target network card device to be upgraded exceeds the preset upgrade time threshold, the upgrade operation of the network card firmware of the target network card device is stopped and the upgrade is determined to have failed. This mechanism avoids the situation where the entire process falls into infinite waiting due to the long upgrade time of individual target network card devices, and improves the efficiency and stability of the system.
[0192] In some alternative embodiments, the above network card firmware upgrade method further includes:
[0193] Step L1, if the upgrade time of the network card firmware in the target network card device to be upgraded does not exceed the preset upgrade time threshold, continue to upgrade the network card firmware in the target network card device.
[0194] The network card firmware upgrade method provided by the embodiments of the present application ensures the stable progress of the upgrade operation and improves the system stability by continuing to upgrade the network card firmware of the target network card device whose upgrade time has not reached the preset upgrade time threshold.
[0195] In some alternative embodiments, the above network card firmware upgrade method further includes:
[0196] Step m1, record the upgrade execution information generated during the upgrade process of the network card firmware in the target network card device to be upgraded.
[0197] Among them, the upgrade process of the BF3 network card is complex and requires multiple data protocols, and there may be a situation where the upgrade fails. As described above, the upgrade execution information generated during the parallel upgrade process of the network card firmware can be recorded through the LogPLDMMessages thread. This thread will record the upgrade execution information of this upgrade in real time through a pipeline. The upgrade execution information includes key information, key steps, and error information during the upgrade process, etc. After the upgrade process ends, this thread reads the upgrade execution information in the pipeline and writes the upgrade execution information into a file.
[0198] Figure 11 It is a schematic flow diagram of the log recording thread provided by the embodiments of the present application. As Figure 11 shown, this flow includes the following steps:
[0199] 1. Determine whether the file / tmp / pldm_fw.log exists. This file / tmp / pldm_fw.log is used to record the upgrade execution information. If the file exists, delete it and create a new / tmp / pldm_fw.log file to ensure that only the upgrade execution information for the current upgrade is recorded each time. If it does not exist, directly create a new / tmp / pldm_fw.log file. The steps to create the new / tmp / pldm_fw.log file are not shown in the figure.
[0200] 2. Open the file / tmp / pldm_fw.log to record the upgrade execution information for the current upgrade.
[0201] Judge whether the file is successfully opened. If the file opening fails, return an error message.
[0202] If the file is successfully opened, continue to execute the following process.
[0203] 3. Use the mkfifo command to create a pipe.
[0204] Judge whether the pipe is successfully created. If the pipe creation fails, close the / tmp / pldm_fw.log file and return an error message. If the pipe is successfully created, continue to execute the following process.
[0205] 4. Open the pipe.
[0206] Judge whether the pipe is successfully opened. If the pipe opening fails, close the / tmp / pldm_fw.log file and return an error message. If the pipe is successfully opened, continue to execute the following process.
[0207] 5. Enter the while loop, and the judgment condition is whether the upgrade thread exists.
[0208] 6. If the upgrade thread exists, read the pipe information and write the read information to the / tmp / pldm_fw.log file. It should be noted that the pipe information is the upgrade execution information generated during the parallel upgrade of the network card firmware, and the upgrade execution information such as key information, key steps, and error information is written to the pipe during the entire upgrade process.
[0209] 7. usleep 1000. That is, let the current thread pause execution for 1000 microseconds and enter the sleep state.
[0210] After pausing execution for 1000 microseconds, return to step 5 of this process.
[0211] 8. Until the upgrade ends and the upgrade thread does not exist, break out of the loop.
[0212] 9. Close the read pipe and release resources.
[0213] 10. Close the file / tmp / pldm_fw.log and release resources.
[0214] The network card firmware upgrade method provided by the embodiments of this application can, through log records, completely save various upgrade execution information during the network card firmware upgrade process. These detailed records provide an important basis for subsequent analysis and troubleshooting. When an exception or failure occurs during the upgrade process, the log records can help technicians quickly locate the problem. By analyzing the key information in the log, the specific cause of the problem can be identified, thus accelerating the speed of problem-solving.
[0215] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0216] The embodiments of this application also provide a network card firmware upgrade device, which is applied to an out-of-band processor, such as Figure 12 shown, and includes:
[0217] An acquisition module 1201, configured to acquire a target network card firmware.
[0218] A first determination module 1202, configured to determine, based on the target network card firmware, at least one target network card device that supports using the target network card firmware for upgrade, and obtain a target network card device set corresponding to the target network card firmware.
[0219] A receiving module 1203, configured to receive network card upgrade requirement information input by a user.
[0220] A second determination module 1204, configured to use the to-be-upgraded network card device as a target to-be-upgraded network card device when any to-be-upgraded network card device characterized by the network card upgrade requirement information belongs to the target network card device set.
[0221] An upgrade module 1205, configured to upgrade the network card firmware in multiple target to-be-upgraded network card devices in parallel based on the target network card firmware.
[0222] In some optional implementation manners, the first determination module 1202 includes:
[0223] A first determination unit, configured to determine a first network card device in the server that supports both the platform-level data model protocol and the management component transport protocol and supports upgrade.
[0224] A second determination unit, configured to determine, based on the target network card firmware, at least one target network card device that supports upgrading using the target network card firmware from the first network card devices.
[0225] In some alternative embodiments, the first determination unit includes:
[0226] A third determination unit, configured to determine, from the transport layer, a second network card device that supports the management component transport protocol.
[0227] A first acquisition unit, configured to acquire the message types supported by the second network card device.
[0228] A fourth determination unit, configured to determine whether the second network card device supports the platform-level data model protocol based on the message types supported by the second network card device.
[0229] A fifth determination unit, configured to, if the second network card device supports the platform-level data model protocol, determine the second network card device as a third network card device that supports both the platform-level data model protocol and the management component transport protocol.
[0230] A first judgment unit, configured to judge whether the third network card device supports upgrading.
[0231] A sixth determination unit, configured to, if the third network card device supports upgrading, determine the third network card device as the first network card device.
[0232] In some alternative embodiments, the second determination unit includes:
[0233] A seventh determination unit, configured to determine, based on the target network card firmware, information about the network card devices supported by the target network card firmware.
[0234] A second acquisition unit, configured to acquire, for any one of the first network card devices, the physical identifier of the first network card device.
[0235] A second judgment unit, configured to judge whether the information about the network card devices supported by the target network card firmware includes the physical identifier of the first network card device.
[0236] An eighth determination unit, configured to, if the information about the network card devices supported by the target network card firmware includes the physical identifier of the first network card device, determine the first network card device as a target network card device that supports upgrading using the target network card firmware.
[0237] In some alternative embodiments, the network card firmware upgrade device further includes:
[0238] The first locking unit is used to perform a mutex locking operation on all network card devices in the server before executing the step of determining the first network card device in the server that supports both the platform-level data model protocol and the management component transfer protocol and supports upgrading, so as to prevent other threads from accessing all network card devices in the server concurrently.
[0239] The first unlock unit is used to perform a mutex unlocking operation on all network card devices in the server after determining the first network card device, so as to allow other threads to access all network card devices in the server.
[0240] In some alternative embodiments, the second determination module 1204 includes:
[0241] The third judgment unit is used to, for any network card device to be upgraded, judge whether there is any logical identifier of a target network card device in the target network card device set that is the same as the logical identifier of this network card device to be upgraded.
[0242] The ninth determination unit is used to, if there is any logical identifier of a target network card device in the target network card device set that is the same as the logical identifier of this network card device to be upgraded, determine that this network card device to be upgraded belongs to the target network card device set, and use this network card device to be upgraded as the target network card device to be upgraded.
[0243] In some alternative embodiments, the network card firmware upgrade device further includes:
[0244] The first return unit is used to, if there is no logical identifier of any target network card device in the target network card device set that is the same as the logical identifier of this network card device to be upgraded, determine that this network card device to be upgraded does not belong to the target network card device set and cannot be upgraded using the target network card firmware, and return an information indicating that the upgrade is not possible.
[0245] In some alternative embodiments, the upgrade module 1205 includes:
[0246] The first creation unit is used to create a corresponding upgrade thread for each target network card device to be upgraded.
[0247] The first upgrade unit is used to execute the upgrade threads of multiple target network card devices to be upgraded in parallel, and upgrade the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
[0248] In some alternative embodiments, the network card firmware upgrade device further includes:
[0249] The first setting unit is used to set the upgrade threads of each target network card device to be upgraded to a detached state.
[0250] In some alternative embodiments, the network card firmware upgrade device further includes:
[0251] A tenth determination unit, configured to perform an upgrade access to a target network card device to be upgraded every first preset time period, so as to determine whether the network card firmware of all target network card devices to be upgraded is completely upgraded.
[0252] A second return unit, configured to, if the network card firmware of all target network card devices to be upgraded is completely upgraded, stop performing the step of performing an upgrade access to the target network card device to be upgraded every first preset time period, and return an upgrade completion message.
[0253] In some alternative embodiments, the network card firmware upgrade device further includes:
[0254] A first execution unit, configured to, if the network card firmware of any target network card device to be upgraded is not completely upgraded, continue to perform the step of performing an upgrade access to the target network card device to be upgraded every first preset time period until the network card firmware of all target network card devices to be upgraded is completely upgraded.
[0255] In some alternative embodiments, the network card firmware upgrade device further includes:
[0256] A second locking unit, configured to perform a mutex locking operation on all network card devices in the server before performing the step of performing an upgrade access to the target network card device to be upgraded every first preset time period to determine whether the network card firmware of all target network card devices to be upgraded is completely upgraded, so as to prevent other threads from performing concurrent access to all network card devices in the server.
[0257] A second unlock unit, configured to perform a mutex unlocking operation on all network card devices in the server when the network card firmware of all target network card devices to be upgraded is completely upgraded, so as to allow other threads to access all network card devices in the server.
[0258] In some alternative embodiments, the network card firmware upgrade device further includes:
[0259] An update unit, configured to, when receiving network card device change information sent by a transport layer, perform the step of determining at least one target network card device that supports being upgraded using the target network card firmware based on the network card device change information, so as to update a target network card device set corresponding to the target network card firmware.
[0260] In some alternative embodiments, the network card firmware upgrade device further includes:
[0261] A fourth determination unit, configured to determine whether the network card firmware in a target network card device to be upgraded is completely upgraded for any target network card device to be upgraded every second preset time period.
[0262] A fifth determination unit, configured to determine whether an upgrade time of a network card firmware in a target network card device to be upgraded exceeds a preset upgrade time threshold if the network card firmware in the target network card device to be upgraded is not upgraded completely.
[0263] An eleventh determination unit, configured to stop further upgrading the network card firmware in the target network card device to be upgraded and determine that the upgrade of the network card firmware in the target network card device to be upgraded fails if the upgrade time of the network card firmware in the target network card device to be upgraded exceeds the preset upgrade time threshold.
[0264] In some alternative embodiments, the network card firmware upgrade device further includes:
[0265] A second execution unit, configured to continue upgrading the network card firmware in the target network card device to be upgraded if the upgrade time of the network card firmware in the target network card device to be upgraded does not exceed the preset upgrade time threshold.
[0266] In some alternative embodiments, the network card firmware upgrade device further includes:
[0267] A log recording unit, configured to record logs for upgrade execution information generated during the upgrade process of the network card firmware in the target network card device to be upgraded.
[0268] For the description of the features in the corresponding embodiment of the network card firmware upgrade device, reference may be made to the relevant description in the corresponding embodiment of the network card firmware upgrade method, which will not be elaborated here one by one.
[0269] An embodiment of the present application further provides an electronic device, as Figure 13 shown, including a processor 1301 and a memory 1302. A computer program is stored in the memory 1302, and the processor 1301 is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the network card firmware upgrade method.
[0270] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above-mentioned embodiments of the network card firmware upgrade method when running.
[0271] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.
[0272] An embodiment of the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the network card firmware upgrade method.
[0273] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the network card firmware upgrade method.
[0274] 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 the two. 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. Skilled professionals 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 the present application.
[0275] The above has introduced in detail a network card firmware upgrade method, device, electronic device, and storage medium provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for upgrading network card firmware, characterized in that, Applied to an out-of-band processor, including: Obtain a target network card firmware, where the network card devices in the server are of the same type, and the target network card firmware is any upgraded version of the current version of the network card firmware of the network card devices in the server; Determine the first network card devices in the server that simultaneously support the platform-level data model protocol and the management component transfer protocol and support upgrading; Based on the target network card firmware, determine the information of the network card devices supported by the target network card firmware; For any first network card device, obtain the physical identifier of the first network card device; Judge whether the information of the network card devices supported by the target network card firmware includes the physical identifier of the first network card device; If the information of the network card devices supported by the target network card firmware includes the physical identifier of the first network card device, determine that the first network card device is a target network card device that supports upgrading using the target network card firmware, and obtain the target network card device set corresponding to the target network card firmware; Receive the network card upgrade requirement information input by the user; For any network card device to be upgraded represented by the network card upgrade requirement information, judge whether there is any target network card device in the target network card device set whose logical identifier is the same as the logical identifier of the network card device to be upgraded, and the logical identifier is the endpoint identifier; If there is any target network card device in the target network card device set whose logical identifier is the same as the logical identifier of the network card device to be upgraded, determine that the network card device to be upgraded belongs to the target network card device set, and use the network card device to be upgraded as the target network card device to be upgraded; Based on the target network card firmware, upgrade the network card firmware of multiple target network card devices to be upgraded in parallel.
2. The network card firmware upgrade method according to claim 1, wherein The determining the first network card devices in the server that simultaneously support the platform-level data model protocol and the management component transfer protocol and support upgrading includes: Determine the second network card devices that support the management component transfer protocol from the transport layer; Obtain the message types supported by the second network card devices; Based on the message types supported by the second network card devices, determine whether the second network card devices support the platform-level data model protocol; If the second network card devices support the platform-level data model protocol, determine that the second network card devices are the third network card devices that simultaneously support the platform-level data model protocol and the management component transfer protocol; Judge whether the third network card devices support upgrading; If the third network card devices support upgrading, determine the third network card devices as the first network card devices.
3. The network card firmware upgrade method according to claim 1, wherein The method further includes: Before executing the step of determining the first network card devices in the server that simultaneously support the platform-level data model protocol and the management component transfer protocol and support upgrading, perform a mutex lock operation on all network card devices in the server to prevent other threads from accessing all network card devices in the server concurrently; After determining the first network card devices, perform a mutex unlock operation on all network card devices in the server to allow other threads to access all network card devices in the server.
4. The network card firmware upgrade method according to claim 1, wherein The method further includes: If there is no logical identifier of any target network card device in the set of target network card devices that is the same as the logical identifier of the network card device to be upgraded, it is determined that the network card device to be upgraded does not belong to the set of target network card devices and cannot be upgraded using the target network card firmware, and an information indicating inability to upgrade is returned.
5. The network card firmware upgrade method according to claim 1, characterized in that Parallelly upgrading the network card firmware in multiple target network card devices to be upgraded based on the target network card firmware includes: Creating a corresponding upgrade thread for each target network card device to be upgraded; Parallelly executing the upgrade threads of multiple target network card devices to be upgraded, and parallelly upgrading the network card firmware in multiple target network card devices to be upgraded based on the target network card firmware.
6. The network card firmware upgrade method according to claim 5, wherein The method further includes: Setting the upgrade thread of each target network card device to be upgraded to a detached state.
7. The method for upgrading the network card firmware according to claim 1, wherein The method further includes: Performing an upgrade access to the target network card devices to be upgraded every first preset time period to determine whether the network card firmware of all target network card devices to be upgraded has been completely upgraded; If the network card firmware of all target network card devices to be upgraded has been completely upgraded, stop performing the step of performing an upgrade access to the target network card devices to be upgraded every first preset time period, and return an information indicating upgrade completion.
8. The network card firmware upgrade method according to claim 7, wherein The method further includes: If the network card firmware of any target network card device to be upgraded has not been upgraded, continue to perform the step of performing an upgrade access to the target network card devices to be upgraded every first preset time period until the network card firmware of all target network card devices to be upgraded has been completely upgraded.
9. The network card firmware upgrade method according to claim 7, wherein The method further includes: Before performing the step of performing an upgrade access to the target network card devices to be upgraded every first preset time period to determine whether the network card firmware of all target network card devices to be upgraded has been completely upgraded, perform a mutex lock operation on all network card devices in the server to prevent other threads from performing concurrent access to all network card devices in the server; When the network card firmware of all target network card devices to be upgraded has been completely upgraded, perform a mutex unlock operation on all network card devices in the server to allow other threads to access all network card devices in the server.
10. The network card firmware upgrade method according to claim 1, characterized in that, The method further includes: When receiving network card device change information sent by the transport layer, based on the network card device change information, perform the step of determining the first network card device in the server that supports both the platform-level data model protocol and the management component transport protocol and supports upgrade, so as to update the set of target network card devices corresponding to the target network card firmware.
11. The network card firmware upgrade method according to claim 1, characterized in that, The method further includes: Judging whether the network card firmware in any target network card device to be upgraded has been upgraded every second preset time period; If the network card firmware in the target network card device to be upgraded has not been upgraded, judge whether the upgrade time of the network card firmware in the target network card device to be upgraded exceeds a preset upgrade time threshold; If the upgrade time of the network card firmware in the target network card device to be upgraded exceeds the preset upgrade time threshold, stop further upgrading the network card firmware in the target network card device to be upgraded, and determine that the upgrade of the network card firmware in the target network card device to be upgraded fails.
12. The network card firmware upgrade method according to claim 11, wherein The method further includes: If the upgrade time of the network card firmware in the target network card device to be upgraded does not exceed the preset upgrade time threshold, continue to upgrade the network card firmware in the target network card device to be upgraded.
13. The network card firmware upgrade method according to claim 1, wherein The method further includes: Log the upgrade execution information generated during the upgrade process of the network card firmware in the target network card device to be upgraded.
14. A network card firmware upgrade device, characterized in that, Applied to an out-of-band processor, it includes: An acquisition module, configured to acquire a target network card firmware, where the network card devices in the server are of the same type of network card device, and the target network card firmware is any upgraded version of the current version of the network card firmware of the network card device in the server; A first determination unit, configured to determine the first network card devices in the server that simultaneously support the platform-level data model protocol and the management component transfer protocol and support upgrade; A seventh determination unit, configured to determine the information of the network card devices supported by the target network card firmware based on the target network card firmware; A second acquisition unit, configured to acquire the physical identifier of any first network card device; A second judgment unit, configured to judge whether the information of the network card devices supported by the target network card firmware includes the physical identifier of the first network card device; An eighth determination unit, configured to if the information of the network card devices supported by the target network card firmware includes the physical identifier of the first network card device, determine that the first network card device is the target network card device supported to use the target network card firmware for upgrade, and obtain the target network card device set corresponding to the target network card firmware; A receiving module, configured to receive the network card upgrade requirement information input by the user; A third judgment unit, configured to for any network card device to be upgraded represented by the network card upgrade requirement information, judge whether there is any logical identifier of a target network card device in the target network card device set that is the same as the logical identifier of the network card device to be upgraded, and the logical identifier is the endpoint identifier; A ninth determination unit, configured to if there is any logical identifier of a target network card device in the target network card device set that is the same as the logical identifier of the network card device to be upgraded, determine that the network card device to be upgraded belongs to the target network card device set, and use the network card device to be upgraded as the target network card device to be upgraded; An upgrade module, configured to upgrade the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
15. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the network card firmware upgrade method according to any one of claims 1 to 13 when executing the computer program.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, where the computer program, when executed by the processor, implements the steps of the network card firmware upgrade method according to any one of claims 1 to 13.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the network card firmware upgrade method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Network card firmware automatic upgrading method and device and computer readable storage medium
CN112463188A
Firmware upgrading method and device, storage medium, electronic equipment and computer program product
CN118394388A
Drive upgrading method and device of magnetic levitation conveying system, computer equipment, readable storage medium and program product
CN119396436A