Network card firmware upgrading method and device, electronic equipment and storage medium
By upgrading the firmware of multiple target network card devices to be upgraded in parallel, the problem of excessive time-consuming and long-term upgrade caused by out-of-band serial upgrade is solved, and a faster network card firmware upgrade process is achieved.
Patent Information
- Application Number
- CN202510363905.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
In the prior art, the firmware of the network card equipment with external serial upgrade takes a long time, resulting in a longer firmware upgrade time for the network card equipment.
By obtaining the target network card firmware, determine the set of target network card devices that support upgrading using this firmware, and receive the network card upgrade requirements information entered by the user. When the conditions are met, the network card device to be upgraded is used as the target network card device to be upgraded, and the network card firmware of multiple target network card devices to be upgraded in parallel based on the target network card firmware.
Through parallel processing, the system resources are fully utilized, which significantly shortens the time for upgrading firmware of multiple network card systems, reduces the time to upgrade firmware of network card devices, and improves the efficiency of network card firmware upgrade.
Smart Images

Figure CN119892617A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a network card firmware upgrade method, device, electronic device and storage medium. Background Art
[0002] A server is a high-performance computer in a network environment that provides storage and processing services. In the related art, the firmware upgrade of the network card device on the server relies on the tools on the server operating system. Due to the particularity of some types of network card devices, they are often upgraded through out-of-band upgrades.
[0003] However, in the related art, the firmware of some types of network card devices is often upgraded out-of-band in a serial manner. Since there are a large number of network card devices in the server, this method causes the firmware upgrade of the network card device to take a long time. Summary of the invention
[0004] The present application provides a network card firmware upgrade method, device, electronic device and storage medium, so as to at least solve the problem in the related art that the firmware upgrade of the network card device is time-consuming due to out-of-band serial upgrade of the firmware of the network card device.
[0005] The present application provides a network card firmware upgrade method, which is applied to an out-of-band processor, including: Get the target network card firmware; 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; Receive network card upgrade requirement information input by the user; When any network card device to be upgraded represented by the network card upgrade requirement information belongs to the target network card device set, the network card device to be upgraded is used as the target network card device to be upgraded; Based on the target network card firmware, the network card firmware in multiple target network card devices to be upgraded are upgraded in parallel.
[0006] The present application also provides a network card firmware upgrade device, which is applied to an out-of-band processor, comprising: The acquisition module is used to obtain the target network card firmware; A first determination module is used 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, and obtain a target network card device set corresponding to the target network card firmware; A receiving module, used for receiving network card upgrade requirement information input by a user; A second determination module is used to, when 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; The upgrade module is used to upgrade the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
[0007] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned network card firmware upgrade methods when executing the computer program.
[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned network card firmware upgrade methods are implemented.
[0009] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned network card firmware upgrade methods when executed by a processor.
[0010] Through the present application, according to the target network card firmware, a set of target network card devices that support upgrading using the target network card firmware is screened out from the server, and according to the network card devices to be upgraded represented 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, and according to the target network card firmware, the network card firmware of the multiple target network card devices to be upgraded are upgraded in parallel. Compared with the serial network card firmware upgrade method in the related art, parallel processing fully utilizes system resources and can complete the firmware upgrade of multiple network cards in a shorter time. Therefore, the technical problem that it takes a long time to serially upgrade the firmware of the network card device out of band can be solved, and the technical effect of reducing the firmware upgrade time of the network card device and improving the efficiency of the network card firmware upgrade is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0012] Figure 1 A schematic diagram of the structure of a network card firmware upgrade system provided in an embodiment of the present application; Figure 2 A topology diagram of the BMC out-of-band parallel upgrade of the BF3 network card firmware provided in an embodiment of the present application; Figure 3 A flowchart of a network card firmware upgrade method provided in an embodiment of the present application; Figure 4 A flowchart of another network card firmware upgrade method provided in an embodiment of the present application; Figure 5 A schematic diagram of the process of discovering a PLDM device thread provided in an embodiment of the present application; Figure 6 A schematic diagram of a process for performing a parallel upgrade of a network card firmware using a firmware upgrade start function provided in an embodiment of the present application; Figure 7 A schematic diagram of a process for updating a first network card device list using the UpdateEidList() function provided in an embodiment of the present application; Figure 8 A schematic diagram of a process for enumerating target network card devices that can be upgraded using the image.pldm firmware package from a first network card device using a firmware upgrade device discovery function provided in an embodiment of the present application; Fig. 9 A flowchart of all firmware upgrade thread status check threads provided in the embodiment of the present application; Fig.10 A schematic diagram of the flow of the timing thread provided in the embodiment of the present application; Fig.11 A flow chart of a log recording thread provided in an embodiment of the present application; Fig.12 A structural block diagram of a network card firmware upgrade device provided in an embodiment of the present application; Fig.13 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0014] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly 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, and are not used to describe a specific order or sequence.
[0015] A server is a high-performance computer in a network environment, used for storage, 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 a traditional network card device is usually completed through tools on the server operating system (Operation System, referred to as OS). However, there are some types of network card devices, such as the third-generation BlueField-3 (BF3) network card and the third-generation low-power BlueField-3 Low Power (BF3L) network card. The firmware of the BF3 network card and the BF3L network card is divided into two parts, one is the CX7 network card firmware, and the other is the Advanced RISC Machine (ARM) firmware. Among them, the CX7 network card is a high-performance network adapter.
[0016] Among them, the update path of ARM firmware is special and can only be completed with the help of the RemoteShim (rshim) debugging interface on the BF3 network card. After the rshim debugging interface is enabled, it has powerful functions. It can not only update the firmware of the BF3 network card, but also achieve full control of the BF3 network card. For example, it can operate and access the embedded multimedia card (eMMC) or solid state drive (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 out-of-band and must be turned off after updating the firmware of the BF3 network card.
[0017] However, enabling and disabling the rshim debugging interface usually requires restarting the server, and may even require powering off the server, which seriously affects the services currently running on the server and may also cause problems such as card and driver loss, making the firmware upgrade process of the BF3 network card on the server extremely complicated.
[0018] Since out-of-band operation is unavoidable due to the enabling operation of the rshim debugging interface, to solve the above problem, 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 that the firmware update can be completed with only one server restart, thereby avoiding the complexity of the upgrade operation caused by multiple power ons and offs and mixed in-band and out-of-band operations.
[0019] However, the out-of-band upgrade of network card firmware solves the problem of complex upgrade operations, but the out-of-band upgrade of network card firmware is often done by serially upgrading the firmware of each network card. Due to the large number of network cards in the server, this serial upgrade of the firmware in the server network card is time-consuming. For example, it takes about 20 minutes to upgrade the firmware of an 80M network card. If the server is configured with 8 network cards, it takes 160 minutes to upgrade the firmware of each network card using the serial method, which is time-consuming and greatly reduces the user experience.
[0020] In response to the above problems, an embodiment of the present application provides a network card firmware upgrade method, device, electronic device and storage medium, which is applied to an out-of-band processor, including: obtaining a target network card firmware; based on the target network card firmware, determining at least one target network card device that supports upgrading using the target network card firmware, and obtaining 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 represented by the network card upgrade requirement information belongs to the target network card device set, using the network card device to be upgraded as the target network card device to be upgraded; 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 scheme uploads the latest version of the network card firmware, namely the target network card firmware, to the out-of-band processor, and according to the target network card firmware, selects from the server a set of target network card devices that support upgrading using the target network card firmware, and according to the network card devices to be upgraded represented by the network card upgrade requirement information input by the user, determines multiple target network card devices to be upgraded belonging to the target network card device set from the network card devices to be upgraded, and according to the target network card firmware, upgrades the network card firmware of the multiple target network card devices to be upgraded in parallel, thereby solving the technical problem that it takes a long time to upgrade the firmware of the network card device in the out-of-band serial manner, and achieving the technical effect of reducing the time consumption of the firmware upgrade of the network card device.
[0021] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0022] In conjunction with the specific application environment architecture or the specific hardware architecture on which the execution of the network card firmware upgrade method depends, the specific application environment architecture or the specific hardware architecture is described herein.
[0023] The network card firmware upgrade method, device, electronic device and storage medium provided in the embodiments of the present application are suitable for an out-of-band processor to perform parallel upgrades on the network card firmware of multiple network card devices in a server through an out-of-band processor. Figure 1 As shown, it is a schematic diagram of the architecture of the network card firmware upgrade system based on the embodiment of the present application. Figure 1As 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, wherein, on the server motherboard, BMC is a small operating system independent of the server's operating system, used to monitor the overall operation of the server, is a management controller unique to the server, and is also used to perform remote management, monitoring, deployment, restarting the server, etc. It should be noted that the embodiment of the present application is described by taking the network card device as a BF3 network card as an example.
[0024] Since the BMC can start running when the power is turned on, it is not affected by the server power on and off, and is independent of the business system. Therefore, the embodiment of the present application migrates the firmware upgrade process of the network card device in the server to the BMC for execution, thereby achieving out-of-band parallel upgrade of the firmware of the network card device in the server. In other words, the BMC can be used as an out-of-band processor to upgrade the firmware of multiple network card devices in the server in parallel.
[0025] Figure 2 The topology diagram of the BMC out-of-band parallel upgrade of the BF3 network card firmware provided in the embodiment of the present application is as follows: Figure 2 As shown, the BMC sets corresponding upgrade threads for multiple BF3 network cards in the server system, wherein 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 the multiple BF3 network cards are executed in parallel, thereby achieving parallel upgrade of the firmware in the multiple BF3 network cards in the server.
[0026] It can be seen that the method of upgrading the firmware of the BF3 network card out of band in parallel by BMC solves the problem of long time consumption of upgrading the firmware of multiple network cards out of band serially, and greatly shortens the time required for upgrading the firmware of the BF3 network card. For example, it takes about 160 minutes to upgrade 8 80M network cards serially, and the parallel upgrade shortens the time to 35 minutes, which greatly shortens the time required for upgrading the network card firmware.
[0027] The embodiment of the present application provides a network card firmware upgrade method, which is applied to an out-of-band processor, and the out-of-band processor may be the baseboard management controller mentioned above. Figure 3 A flowchart of a network card firmware upgrade method provided in an embodiment of the present application, such as Figure 3 As shown, the process includes the following steps: Step S301, obtaining the target network card firmware.
[0028] The target network card firmware may be the latest version of the network card firmware of the network card device in the current server, or may be any upgraded version of the current version of the network card firmware of the network card device in the current server.
[0029] It should be noted that the network card devices in the server can all be BF3 network cards, or can all be BF3L network cards, or of course, can also be other types of network card devices, and no specific restrictions are made 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 network card firmware of the BF3 network card.
[0030] After obtaining the target network card firmware, you can upload the target network card firmware to the / var / path of the BMC and rename it to image.pldm.
[0031] 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 a target network card device set corresponding to the target network card firmware.
[0032] After the target network card firmware is obtained, it is necessary to determine from the server at least one target network card device that supports upgrading using the target network card firmware. These target network card devices constitute a target network card device set corresponding to the target network card firmware.
[0033] It is understandable that the target network card device set may be recorded in a list, that is, the logical identifier of each target network card device in the target network card device set may be recorded in a list.
[0034] Step S303: receiving network card upgrade requirement information input by the user.
[0035] The user can input the network card upgrade requirement information in the BMC interface according to the requirement, and the network card upgrade requirement information can include the logical identifier of the network card device to be upgraded. It is understandable that the network card upgrade requirement information input by the user can represent all BF3 network cards in the server, and can also represent one or more BF3 network cards that the user wants to upgrade.
[0036] Step S304: when any network card device to be upgraded represented by the network card upgrade requirement information belongs to the target network card device set, the network card device to be upgraded is used as the target network card device to be upgraded.
[0037] 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 means that the network card device to be upgraded can be upgraded using the target network card firmware, then the network card device to be upgraded is determined to be the target network card device to be upgraded.
[0038] It should be noted that the logical identifier is the endpoint identifier (EID), which is used in the Management Component Transport Protocol (MCTP) to uniquely identify each MCTP endpoint in the system. Each MCTP endpoint needs to be assigned a unique EID. Among them, the EID can be dynamically allocated by the management controller (such as BMC) in the MCTP network, or it can be pre-defined through static configuration. When the system starts, the management controller usually allocates an EID to each MCTP endpoint.
[0039] Step S305: based on the target network card firmware, the network card firmware in multiple target network card devices to be upgraded are upgraded in parallel.
[0040] When multiple target network card devices to be upgraded belonging to the target network card device set are obtained among multiple network card devices to be upgraded represented by the network card upgrade requirement information, the network card firmware in the multiple target network card devices to be upgraded are upgraded in parallel based on the target network card firmware.
[0041] The network card firmware upgrade method provided in the embodiment of the present application obtains the target network card firmware, enumerates the target network card devices that support the target network card firmware for upgrading according to the target network card firmware, obtains 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 represented by the network card upgrade requirement information belongs to the target network card device set, the network card device to be upgraded is used as the target network card device to be upgraded, and the network card firmware in multiple target network card devices to be upgraded are upgraded in parallel based on the target network card firmware. This out-of-band parallel upgrade of network card firmware shortens the time for upgrading multiple network card firmwares, improves the upgrade efficiency, reduces the impact of the network card firmware upgrade on the system business, ensures the normal operation of the business on the server, and solves the problem of long time consumption and poor user experience of out-of-band serial upgrade of network card device firmware in the related technology.
[0042] The embodiment of the present application provides a network card firmware upgrade method, which is applied to an out-of-band processor, and the out-of-band processor may be the baseboard management controller mentioned above. Figure 4 A flowchart of a network card firmware upgrade method provided in an embodiment of the present application, such as Figure 4 As shown, the process includes the following steps: Step S401, obtain the target network card firmware. For details, see Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.
[0043] 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 a target network card device set corresponding to the target network card firmware.
[0044] Specifically, the above step S402 includes: Step S4021, determining a first network card device in the server that supports both the platform-level data model protocol and the management component transmission protocol and supports upgrading.
[0045] Among them, the Platform Level Data Model (PLDM) is an application layer protocol, and MCTP is a transport layer protocol.
[0046] Use the PLDM device discovery (DiscoverPldmDevice) thread to discover the network card devices in the server that support the PLDM overMCTP protocol in real time, that is, the network card devices that support both the PLDM protocol and the MCTP protocol.
[0047] Figure 5 FIG. 1 is a flow chart of a PLDM device discovery thread according to an embodiment of the present application. Figure 5 As shown, the PLDM device discovery thread includes the following steps: 1. Enter the while (1) infinite loop to ensure that the thread continues to work and repeat the subsequent process.
[0048] 2. Locking. Because the network card device will be accessed to obtain relevant information during the enumeration of the first network card device, and the network card device will also be interacted with when the network card firmware is upgraded. If two threads access the network card device at the same time, the network card firmware upgrade will fail. 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 performed at the same time. Locking is required.
[0049] 3. Use the UpdateEidList() function to update the EID list, that is, update the first network card device list, which includes the EID of the first network card device.
[0050] 4. Release the lock. After updating the first network card device list, you need to release the lock to allow other threads to access the network card device.
[0051] 5. Use the recvfrom() function to block and wait for information sent by the MCTP layer. The recvfrom() function is a function used to receive data from a socket. When the function is called, it works in blocking mode by default, which means that after calling the function, the execution flow of the program will be suspended at this step until data is sent from the specified source. In this embodiment, the specified source is the MCTP layer.
[0052] When hot-swappable devices are plugged in or out, the MCTP layer is able to sense these changes and update the device list it maintains. For example, when a new network card is plugged into the system, the MCTP layer adds the network card to the device list.
[0053] When the device list of the MCTP layer changes, the MCTP layer will send corresponding messages to notify other components. At this time, the recvfrom() function that was originally in a blocked state will receive these messages, and the execution flow of the program will continue to move 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 based on the MCTP layer. When recvfrom() receives the device list change message sent by the MCTP layer, the PLDM application layer will synchronize and update the device list it maintains based on these messages. For example, if the MCTP layer adds a new device, the PLDM application layer will also add the device information to its own device list; if a device is removed, the PLDM application layer will also delete the device information accordingly.
[0054] If the device list of the MCTP layer has not changed, it means that the MCTP layer will not send a message about the device list change. Then the recvfrom() function will be in a blocked state, and the program will wait until new data (such as a device list change message) arrives.
[0055] Step S4022: Based on the target network card firmware, determine at least one target network card device that supports upgrading using the target network card firmware from the first network card device.
[0056] Among them, the PLDM device discovery thread enumerates the first network card device that supports both the PLDM protocol and the MCTP protocol and supports upgrade, and uses the firmware upgrade device discovery function, namely 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 device.
[0057] Step S403: Receive network card upgrade requirement information input by the user. Figure 3 Step S303 of the illustrated embodiment will not be described in detail here.
[0058] Step S404: when any network card device to be upgraded represented by the network card upgrade requirement information belongs to the target network card device set, the network card device to be upgraded is used as the target network card device to be upgraded.
[0059] Specifically, the above step S404 includes: 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 the logical identifier of the network card device to be upgraded.
[0060] Step S4042: 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, 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.
[0061] The firmware upgrade start function, i.e., StartPldmUpdate function, is used to perform parallel upgrade of the network card firmware. The input parameters of the function are the number of network card devices to be upgraded, count, and the list of network card devices to be upgraded. It can be understood that the input parameters of the 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.
[0062] Figure 6 The flowchart of the embodiment of the present application using the firmware upgrade start function to perform parallel upgrade of the network card firmware. Figure 6 As shown, the process includes the following steps: 1. Before using the firmware upgrade start function to perform a parallel upgrade of the network card firmware, a log recording thread, namely, the LogPLDMMessages thread, is created and separated. The log recording thread is used to record the upgrade execution information generated during the parallel upgrade of the network card firmware.
[0063] 2. Traverse the input parameter device list, that is, traverse the list of network card devices to be upgraded.
[0064] 3. Traverse the gFwUpdateContextList global variable, which is a global structure array used to store the information required for upgrading each target network card device, including the logical identifier of each target network card device, the context information required for the maintenance and upgrade of each target network card device, etc. The gFwUpdateContextList global variable is also used to store the number of target network card devices.
[0065] 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 gFwUpdateContextList. In other words, 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 gFwUpdateContextList.
[0066] 5. If the EID of the currently traversed network card device to be upgraded is equal to the EID of gFwUpdateContextList, that is, the logical identifier of the currently traversed network card device to be upgraded is the same as the logical identifier of the target network card device currently traversed in gFwUpdateContextList, then it is determined that a matching device is found, the flag position is 1, and the loop is jumped out, that is, the logical identifiers of the remaining target network card devices in gFwUpdateContextList are no longer traversed. Among them, the flag bit is used to indicate whether a matching device is found. The flag bit is 1 to indicate that a matching device is found, and not 1 to indicate that a matching device is not found.
[0067] 6. If the EID of the currently traversed network card device to be upgraded is not equal to the EID of gFwUpdateContextList, that is, the logical identifier of the currently traversed network card device to be upgraded is different from the logical identifier of the currently traversed target network card device in gFwUpdateContextList, then continue to traverse the logical identifier of the next target network card device in gFwUpdateContextList until a matching device is found or all logical identifiers of the target network card devices in gFwUpdateContextList are traversed.
[0068] 7. Determine whether the flag is 1. In other words, determine whether a matching device is found.
[0069] If the flag bit is not 1, it is determined that no matching device is found and the upgrade process is exited. In other words, if there is no target network card device in the target network card device set whose logical identifier is the same as the logical identifier of the current 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 the target network card firmware cannot be used for upgrading, and the upgrade failure information is returned.
[0070] 8. If the flag is 1, it is determined that a matching device is found, and an upgrade thread StartUpdate is created. That is, 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.
[0071] 9. Detach thread (pthread_detach). Set the upgrade thread of each target network card device to be upgraded to a detached state, so that it automatically releases resources when it is finished, without the need for other threads to operate. This can reduce the occupation of system resources and avoid resource leakage.
[0072] 10. Continue to the next cycle. 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 thread of each target network card device to be upgraded is executed in parallel, so as to realize the parallel upgrade of the network card firmware of multiple target network card devices to be upgraded.
[0073] 11. Create a thread for checking the status of all firmware upgrade threads, namely, the thread AllFdFwUpdateStatusChecker, and separate the thread. This thread is used to indicate whether all upgrade threads have ended.
[0074] Step S405: based on the target network card firmware, the network card firmware in multiple target network card devices to be upgraded are upgraded in parallel.
[0075] The network card firmware upgrade method provided in the embodiment of the present application first determines the first network card device in the server that supports both the PLDM protocol and the MCTP protocol and supports the upgrade, and then determines the target network card device that supports the upgrade using the target network card firmware from the first network card device, thereby achieving the effect of accurately determining the target network card device, 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 device that meets the user's needs and meets the upgrade conditions will be upgraded as the target network card device to be upgraded, thereby improving the accuracy and reliability of the upgrade operation.
[0076] In some optional implementations, the above step S4021 includes: Step a1: determine, from the transport layer, a second network card device that supports the management component transport protocol.
[0077] Step a2: Obtain the message type supported by the second network card device.
[0078] Step a3: determining 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.
[0079] Step a4: if the second network card device supports the platform-level data model protocol, determine that the second network card device is a third network card device that supports both the platform-level data model protocol and the management component transmission protocol.
[0080] Step a5, determining whether the third network card device supports upgrading.
[0081] Step a6: if the third network card device supports upgrading, the third network card device is determined as the first network card device.
[0082] As mentioned above, the UpdateEidList() function is used to update the first network card device list. Figure 7 The flowchart of using UpdateEidList() function to update the first network card device list provided by the embodiment of the present application is as follows: Figure 7 As shown, the process includes the following steps: 1. Use the GetPldmEndPointInfoFromMctp() function to obtain the number of network card devices that support the MCTP protocol and the message types supported by the network card devices that support the MCTP protocol from the MCTP layer.
[0083] 2. According to the message types supported by the network card device supporting the MCTP protocol, determine the network card device that supports both the MCTP protocol and the PLDM protocol, that is, the third network card device. This step is not shown in the figure.
[0084] 3. Use the calloc() function to apply for space for storing information about the first network card device, where the information about the first network card device includes the EID of the network card device, the media type, and other information.
[0085] 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.
[0086] The GetPldmTypeReq() function is used to send a command to each third network card device. If the command is sent to any third network card device successfully, the global variable gEidListCount is increased by 1, and the eid of the third network card device is assigned to the requested space, that is, gpPldmEidList[i].eid=eids. 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 device.
[0087] If sending a command to any third network card device fails, the current cycle is skipped and the next third network card device is accessed.
[0088] Until all the third network card devices are traversed, the first network card device is obtained.
[0089] The network card firmware upgrade method provided in the embodiment of the present application first determines the second network card device that supports the MCTP protocol through step-by-step screening, and then further determines whether it supports the PLDM protocol, and finally obtains a third network card device that supports both protocols. After determining the third network card device, it is also determined whether it supports the upgrade. This step can effectively avoid unnecessary upgrade attempts for network card devices that do not have the upgrade capability, reduce network card failures, system instability and other problems caused by incompatible upgrades, and improve the success rate and reliability of the upgrade operation.
[0090] In some optional implementations, the above step S4022 includes: Step b1, based on the target network card firmware, determine the information of the network card device supported by the target network card firmware.
[0091] Step b2: for any first network card device, obtain a physical identifier of the first network card device.
[0092] Step b3: determine whether the information of the network card device supported by the target network card firmware includes the physical identifier of the first network card device.
[0093] Step b4: if the information of the network card device supported by the target network card firmware includes the physical identifier of the first network card device, then determining that the first network card device is a target network card device that supports upgrading using the target network card firmware.
[0094] As mentioned above, the target network card devices that can be upgraded using the image.pldm firmware package are enumerated from the first network card device using the firmware upgrade device discovery function, namely, the DiscoverFirmwareDevice() function. Figure 8 The flowchart of using the firmware upgrade device discovery function to enumerate the target network card devices that can be upgraded using the image.pldm firmware package from the first network card device provided by the embodiment of the present application is as follows: Figure 8 As shown, the process includes the following steps: 1. Use the GetLocalPldmEidByType() function to obtain the number of first network card devices and the EID information of the first network card device. The number of first network card devices and the EID information of the first network card device can be obtained from the global variable gEidListCount and the global structure gpPldmEidList of the DiscoverPldmDevice thread.
[0095] 2. Get the information of the firmware package image.pldm, that is, the information of the network card device supported by the target network card firmware.
[0096] 3. Traverse the pldm devices that support upgrade, that is, traverse the first network card device list.
[0097] 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, where the device identifier is a physical identifier of the first network card device, wherein each network card device corresponds to a unique physical identifier.
[0098] 5. Determine whether the information obtained from the firmware package is equal to the device identifier.
[0099] 6. If they are not equal, continue to traverse the next first network card device in the first network card device list.
[0100] 7. If they are equal, the number of fd_idx is increased by 1. The fd_idx is used to represent the number of target network card devices. The information obtained by accessing the device, i.e., the physical identifier, is assigned 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.
[0101] The network card firmware upgrade method provided in the embodiment of the present application ensures that only network card devices compatible with the firmware are marked as upgradeable devices by clarifying the network card device information supported by the target network card firmware. This can avoid upgrade failures or device failures caused by incompatibility.
[0102] In some optional implementations, the network card firmware upgrade method further includes: Step c1, 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 transmission protocol and supports upgrading, perform a mutex lock operation on all network card devices in the server to prevent other threads from concurrently accessing all network card devices in the server.
[0103] Step c2: after determining the first network card device, releasing the mutex lock operation on all network card devices in the server to allow other threads to access all network card devices in the server.
[0104] For details, please refer to steps 2 and 4 in the above PLDM device discovery thread, which will not be repeated here.
[0105] The network card firmware upgrade method provided in the embodiment of the present application can ensure that no other threads simultaneously access or modify these network card devices during the time period by adding a mutex lock operation to all network card devices in the server before determining the first network card device. This effectively avoids concurrent access conflicts in a multi-threaded environment, ensures data consistency and integrity, and improves system stability and reliability.
[0106] In some optional implementations, the network card firmware upgrade method further includes: Step d1: If there is no 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 determined that the network card device to be upgraded does not belong to the target network card device set, and the target network card firmware cannot be used for upgrading, and the upgrade failure information is returned.
[0107] For details, please refer to step 2 to step 7 in the aforementioned process of parallel upgrading of the network card firmware using the firmware upgrade start function, which will not be repeated here.
[0108] The network card firmware upgrade method provided in the embodiment of the present application can clearly determine whether the network card device to be upgraded belongs to the target network card device set by comparing the logical identifier. 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, the information that the upgrade cannot be performed 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 identifier, it is ensured that only qualified network card devices can enter the upgrade process, thereby improving the stability and reliability of the system.
[0109] In some optional implementations, the above step S405 includes: Step e1: Create a corresponding upgrade thread for each target network card device to be upgraded.
[0110] Step e2, executing the upgrade threads of multiple target network card devices to be upgraded in parallel, and upgrading the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
[0111] For details, please refer to step 8 and step 10 in the aforementioned process of parallel upgrading of the network card firmware using the firmware upgrade start function, which will not be repeated here.
[0112] The network card firmware upgrade method provided in the embodiment of the present application can significantly shorten the time required for the overall upgrade by creating an independent upgrade thread 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 target network card device to be upgraded is abnormal or fails, it will not affect the upgrade operations in progress in other threads. This isolation mechanism enhances the fault tolerance and stability of the system.
[0113] In some optional implementations, the network card firmware upgrade method further includes: Step f1, setting the upgrade thread of each target network card device to be upgraded to a separated state.
[0114] For details, please refer to step 9 in the aforementioned process of performing parallel upgrade of the network card firmware using the firmware upgrade start function, which will not be described in detail here.
[0115] The network card firmware upgrade method provided by the embodiment of the present application sets the upgrade thread of each target network card device to be upgraded to a detached state. After the thread in the detached state is executed, the operating system automatically releases the resources it occupies without explicitly calling the thread connection operation. This avoids the memory leak problem 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 deadlock or other abnormal situations. By using the detached state, the reliance on thread connection operations is reduced, the risk of thread management-related problems is reduced, and the stability of the program is enhanced.
[0116] In some optional implementations, the network card firmware upgrade method further includes: Step g1: Performing an upgrade access to the target network card devices 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 have been completely upgraded.
[0117] The first preset time period is set by a technician and is not specifically limited herein. For example, the first preset time period may be 5 seconds.
[0118] Step g2: if the network card firmware of all target network card devices to be upgraded are upgraded, then the step of performing upgrade access to the target network card devices to be upgraded at intervals of the first preset time period is stopped, and upgrade completion information is returned.
[0119] As mentioned above, create a thread AllFdFwUpdateStatusChecker, which is used to indicate whether all the update threads have ended. Specifically, Fig. 9 This is a flowchart of all firmware upgrade thread status check threads provided in the embodiment of the present application. Fig. 9 As shown, the process includes the following steps: 1. Initialize the continue loop variable, continueLoop, to 1.
[0120] 2. Lock to prevent the network card firmware upgrade thread and DiscoverPldmDevice thread from accessing the network card device at the same time.
[0121] 3. Enter the while (continueLoop) loop and assign continueLoop a value of 0.
[0122] 4. Traverse gFwUpdateContextList. Determine whether there is a network card device being upgraded. If there is a network card device being upgraded, continueLoop is set to 1 and the loop continues. If there is no network card device being upgraded, continueLoop is set to 0 and the loop exits the next round.
[0123] 5. sleep(5). This means that the current thread will pause for 5 seconds and enter a dormant state, thereby releasing CPU resources and giving other threads a chance to execute.
[0124] If there is a network card device being upgraded, after pausing for 5 seconds, return to step 3 of the process.
[0125] 6. Release the lock. It is understandable that the lock is released when there is no network card device being upgraded.
[0126] The network card firmware upgrade method provided in the embodiment of the present 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 inspection mechanism ensures that the system can grasp the upgrade progress of all target network card devices to be upgraded in a timely manner, thereby improving the response speed and reliability of the system. When the network card firmware of all target network card devices to be upgraded is fully upgraded, the periodic inspection operation is immediately stopped and the upgrade completion information is returned. This avoids unnecessary repeated inspections, reduces the waste of system resources, and improves overall efficiency.
[0127] In some optional implementations, the network card firmware upgrade method further includes: Step h1, 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 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 are upgraded.
[0128] For details, please refer to step 4 in the process of all firmware upgrade thread status check threads mentioned above, which will not be repeated here.
[0129] The network card firmware upgrade method provided in the embodiment of the present application can ensure that no device is missed or not successfully upgraded by continuously performing periodic checks until the firmware of all target network card devices to be upgraded is fully upgraded, which ensures the integrity and consistency of the upgrade process. If there are some target network card devices to be upgraded that are upgraded slowly or have temporary problems (such as network delays, resource competition, etc.), this cyclic 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.
[0130] In some optional implementations, the network card firmware upgrade method further includes: Step i1, before executing the step of performing upgrade access to the target network card devices 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 have been completely upgraded, a mutex lock operation is performed on all network card devices in the server to prevent other threads from concurrently accessing all network card devices in the server.
[0131] Step i2, when the network card firmware of all target network card devices to be upgraded are completely upgraded, a mutex lock release operation is performed on all network card devices in the server to allow other threads to access all network card devices in the server.
[0132] For details, please refer to step 2 and step 6 in the above-mentioned process of all firmware upgrade thread status check threads, which will not be repeated here.
[0133] The network card firmware upgrade method provided in the embodiment of the present application can effectively prevent other threads from concurrently accessing these network card devices by performing a mutex lock operation on all network card devices in the server before performing a periodic check on the upgrade status, thereby avoiding data inconsistency or conflict problems caused by multiple threads operating the same resource at the same time. 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, thereby ensuring the consistency and integrity of the data. This protection mechanism is particularly important for complex operations in a multi-threaded environment.
[0134] In some optional implementations, the network card firmware upgrade method further includes: Step j1, upon receiving the network card device change information sent by the transport layer, based on the network card device change information, execute the step of determining at least one target network card device that supports upgrading using the target network card firmware based on the target network card firmware, so as to update the target network card device set corresponding to the target network card firmware.
[0135] For details, please refer to step 5 in the process of the PLDM device discovery thread mentioned above, which will not be repeated here.
[0136] The network card firmware upgrade method provided in the embodiment of the present application can sense the status changes of the network card device in the network in real time by receiving the network card device change information sent by the transport layer. This dynamic adaptability ensures that the upgrade process is always based on the latest device information. Based on the network card device change information and the target network card firmware, the set of devices that support the upgrade using the firmware is determined. This process ensures that only qualified network card devices are included in the upgrade scope, avoiding misoperation of incompatible devices and improving the accuracy of the upgrade.
[0137] In some optional implementations, the network card firmware upgrade method further includes: Step k1: at intervals of a second preset time period, for any target network card device to be upgraded, determining whether the network card firmware in the target network card device to be upgraded is upgraded.
[0138] The second preset time period can be set by a technician and is not specifically limited here. For example, the second preset time period can be 1 second.
[0139] 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 a preset upgrade time threshold.
[0140] 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, then stop upgrading the network card firmware in the target network card device to be upgraded, and determine that the upgrade of the network card firmware of the target network card device to be upgraded has failed.
[0141] 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 to avoid affecting the overall progress due to the firmware upgrade of a single network card device being stuck.
[0142] Fig.10 This is a flow chart of the timing thread provided in the embodiment of the present application. Fig.10 As shown, the process includes the following steps: 1. Assign an initial value of 0 to the variable time.
[0143] 2. Enter the while (1) infinite loop to determine whether the time value is equal to the threshold, where the threshold is the preset upgrade time threshold.
[0144] If the time value is equal to the threshold, it means that the timing time has arrived, and 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 means whether the network card firmware is being upgraded.
[0145] 3. If the time value is not equal to the threshold, it is determined whether the upgrade thread exists. If the upgrade thread does not exist, it means that the upgrade is completed and 0 is returned directly.
[0146] If the upgrade thread exists, sleep 1. This means that the current thread will pause for 1 second and enter a dormant state. After the time value is increased by 1, the loop will continue.
[0147] It is understandable that the process of the aforementioned steps k1 to k3 is slightly different from the process of the timing thread in terms of order, but the effects achieved are the same, that is, the timing thread can be used to achieve the effects achieved by the aforementioned steps k1 to k3.
[0148] The network card firmware upgrade method provided in the embodiment 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 the second preset time period. This mechanism ensures that the system can promptly discover the target network card device to be upgraded that has 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 to be upgraded is stopped, and the upgrade failure is determined. This mechanism avoids the situation where the entire process falls into an infinite waiting state due to the long upgrade time of individual target network card devices to be upgraded, thereby improving the efficiency and stability of the system.
[0149] In some optional implementations, the network card firmware upgrade method further includes: 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, then continue to upgrade the network card firmware in the target network card device to be upgraded.
[0150] The network card firmware upgrade method provided in the embodiment 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 to be upgraded whose upgrade time has not reached the preset upgrade time threshold.
[0151] In some optional implementations, the network card firmware upgrade method further includes: Step m1, log recording the upgrade execution information generated during the network card firmware upgrade process in the target network card device to be upgraded.
[0152] Among them, the upgrade process of the BF3 network card is complicated and needs to go through multiple data protocols, and there may be upgrade failures. As mentioned 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 the pipeline. The upgrade execution information includes key information, key steps, and error information in the upgrade process. After the upgrade process is completed, the thread reads the upgrade execution information in the pipeline and writes the upgrade execution information to the file.
[0153] Fig.11 A flow chart of a log recording thread provided in an embodiment of the present application is as follows: Fig.11 As shown, the process includes the following steps: 1. Determine whether the file / tmp / pldm_fw.log exists. The file / tmp / pldm_fw.log is used to record the upgrade execution information. If the file exists, delete the file and create a new / tmp / pldm_fw.log file to ensure that each upgrade only records the upgrade execution information of the current upgrade. If it does not exist, directly create a new / tmp / pldm_fw.log file. The step of creating a new / tmp / pldm_fw.log file is not shown in the figure.
[0154] 2. Open the file / tmp / pldm_fw.log to record the upgrade execution information of this upgrade.
[0155] Determines whether the file is opened successfully. If the file fails to be opened, an error message is returned.
[0156] If the file is opened successfully, continue to execute the following process.
[0157] 3. Use the mkfifo command to create a pipe.
[0158] Determine whether the pipeline creation is successful. If the pipeline creation fails, close the / tmp / pldm_fw.log file and return an error message. If the pipeline creation is successful, continue to execute the following process.
[0159] 4. Open the pipeline.
[0160] Determine whether the pipe is opened successfully. If the pipe fails to be opened, close the / tmp / pldm_fw.log file and return an error message. If the pipe is opened successfully, continue to execute the following process.
[0161] 5. Enter the while loop and determine whether the upgrade thread exists.
[0162] 6. If the upgrade thread exists, read the pipeline information and write the read information to the / tmp / pldm_fw.log file. It should be noted that the pipeline information is the upgrade execution information generated during the parallel upgrade process of the network card firmware. During the entire upgrade process, the upgrade execution information such as key information, key steps, and error information is written into the pipeline.
[0163] 7. usleep 1000. This means that the current thread will suspend execution for 1000 microseconds and enter a dormant state.
[0164] After pausing execution for 1000 microseconds, the process returns to step 5.
[0165] 8. Until the upgrade is completed, the upgrade thread does not exist and the loop is exited.
[0166] 9. Close the read pipe and release resources.
[0167] 10. Close the file / tmp / pldm_fw.log to release resources.
[0168] The network card firmware upgrade method provided in the embodiment of the present application can completely save various upgrade execution information in the network card firmware upgrade process through log records, and these detailed records provide an important basis for subsequent analysis and troubleshooting. When an abnormality or failure occurs during the upgrade process, 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 clearly identified, thereby speeding up the problem resolution.
[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0170] The embodiment of the present application also provides a network card firmware upgrade device, which is applied to an out-of-band processor, such as Fig.12 As shown, including: The acquisition module 1201 is used to acquire the target network card firmware.
[0171] The first determination module 1202 is 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, and obtain a target network card device set corresponding to the target network card firmware.
[0172] The receiving module 1203 is used to receive network card upgrade requirement information input by the user.
[0173] The second determining module 1204 is configured to, when 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 a target network card device to be upgraded.
[0174] The upgrading module 1205 is used to upgrade the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
[0175] In some optional implementations, the first determining module 1202 includes: The first determining unit is used to determine a first network card device in the server that supports both the platform-level data model protocol and the management component transmission protocol and supports upgrading.
[0176] The second determining unit is configured to determine, based on the target network card firmware, at least one target network card device from the first network card device that supports upgrading using the target network card firmware.
[0177] In some optional implementations, the first determining unit includes: The third determining unit is used to determine, from the transport layer, a second network card device that supports the management component transport protocol.
[0178] The first acquisition unit is used to acquire the message type supported by the second network card device.
[0179] The fourth determining unit is used to determine whether the second network card device supports the platform-level data model protocol based on the message type supported by the second network card device.
[0180] The fifth determining unit is configured to determine that the second network card device is a third network card device that supports both the platform-level data model protocol and the management component transmission protocol if the second network card device supports the platform-level data model protocol.
[0181] The first determination unit is used to determine whether the third network card device supports upgrading.
[0182] The sixth determining unit is configured to determine the third network card device as the first network card device if the third network card device supports upgrading.
[0183] In some optional implementations, the second determining unit includes: The seventh determining unit is used to determine information of the network card device supported by the target network card firmware based on the target network card firmware.
[0184] The second acquisition unit is configured to acquire a physical identifier of the first network card device for any first network card device.
[0185] The second determining unit is configured to determine whether the information of the network card device supported by the target network card firmware includes the physical identifier of the first network card device.
[0186] The eighth determining unit is configured to determine that the first network card device is a target network card device that supports upgrading using the target network card firmware if the information of the network card device supported by the target network card firmware includes the physical identifier of the first network card device.
[0187] In some optional implementations, the network card firmware upgrade device further includes: The first locking unit is used to perform a mutex lock 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 transmission protocol and supports upgrading, so as to prevent other threads from concurrently accessing all network card devices in the server.
[0188] The first lock releasing unit is used to release the mutex lock 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.
[0189] In some optional implementations, the second determining module 1204 includes: The third judgment unit is used to judge, for any network card device to be upgraded, 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.
[0190] The ninth determining unit is used to determine that the network card device to be upgraded belongs to the target network card device set 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, and to use the network card device to be upgraded as the target network card device to be upgraded.
[0191] In some optional implementations, the network card firmware upgrade device further includes: The first returning unit is used to determine 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 if there is no 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. The target network card firmware cannot be used for upgrading, and the upgrade failure information is returned.
[0192] In some optional implementations, the upgrade module 1205 includes: The first creating unit is used to create a corresponding upgrade thread for each target network card device to be upgraded.
[0193] The first upgrading unit is used to execute upgrading threads of multiple target network card devices to be upgraded in parallel, and upgrade the network card firmwares in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
[0194] In some optional implementations, the network card firmware upgrade device further includes: The first setting unit is used to set the upgrade thread of each target network card device to be upgraded to a separated state.
[0195] In some optional implementations, the network card firmware upgrade device further includes: The tenth determining unit is used to perform an upgrade access to the target network card devices 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 have been completely upgraded.
[0196] The second returning unit is used to stop executing the step of performing upgrade access to the target network card devices to be upgraded at intervals of the first preset time period if the network card firmware of all target network card devices to be upgraded are completely upgraded, and return upgrade completion information.
[0197] In some optional implementations, the network card firmware upgrade device further includes: The first execution unit is used to continue to execute the step of performing upgrade access to the target network card device to be upgraded at intervals of a first preset time period if the network card firmware of any target network card device to be upgraded has not been upgraded, until the network card firmware of all target network card devices to be upgraded have been upgraded.
[0198] In some optional implementations, the network card firmware upgrade device further includes: The second locking unit is used to perform a mutex lock operation on all network card devices in the server before executing the step of performing upgrade access to the target network card devices 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 have been completely upgraded, so as to prevent other threads from concurrently accessing all network card devices in the server.
[0199] The second lock releasing unit is used to release the mutex lock on all the network card devices in the server when the network card firmware of all target network card devices to be upgraded are upgraded completely, so as to allow other threads to access all the network card devices in the server.
[0200] In some optional implementations, the network card firmware upgrade device further includes: The update unit is used to, upon receiving the network card device change information sent by the transport layer, execute the step of determining at least one target network card device that supports upgrading using the target network card firmware based on the target network card firmware based on the network card device change information, so as to update the target network card device set corresponding to the target network card firmware.
[0201] In some optional implementations, the network card firmware upgrade device further includes: The fourth judgment unit is used to judge whether the network card firmware in any target network card device to be upgraded is upgraded every second preset time period.
[0202] The fifth judgment unit is used to 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 of the network card firmware in the target network card device to be upgraded is not completed.
[0203] The eleventh determining unit is used to stop 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 exceeds a preset upgrade time threshold, and determine that the upgrade of the network card firmware of the target network card device to be upgraded fails.
[0204] In some optional implementations, the network card firmware upgrade device further includes: The second execution unit is 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 a preset upgrade time threshold.
[0205] In some optional implementations, the network card firmware upgrade device further includes: The log recording unit is used to log the upgrade execution information generated during the network card firmware upgrade process in the target network card device to be upgraded.
[0206] For the description of the features in the embodiment corresponding to the network card firmware upgrade device, reference can be made to the relevant description of the embodiment corresponding to the network card firmware upgrade method, which will not be repeated here.
[0207] The embodiment of the present application also provides an electronic device, such as Fig.13 As shown, it includes a processor 1301 and a memory 1302, in which a computer program is stored. The processor 1301 is configured to run the computer program to execute the steps in any of the above network card firmware upgrade method embodiments.
[0208] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned network card firmware upgrade method embodiments when running.
[0209] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0210] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned network card firmware upgrade method embodiments are implemented.
[0211] 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 storing a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned network card firmware upgrade method embodiments are implemented.
[0212] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0213] The above is a detailed introduction to a network card firmware upgrade method, device, electronic device and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A network card firmware upgrade method, characterized in that: Applicable to out-of-band processors, including: Get the target network card firmware; 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; Receive network card upgrade requirement information input by the user; In the case where any network card device to be upgraded represented by the network card upgrade requirement information belongs to the target network card device set, the network card device to be upgraded is used as the target network card device to be upgraded; Based on the target network card firmware, the network card firmware in a plurality of the target network card devices to be upgraded are upgraded in parallel.
2. The network card firmware upgrade method according to claim 1, characterized in that: The step of determining, based on the target network card firmware, at least one target network card device that supports upgrading using the target network card firmware includes: Determine a first network card device in the server that supports both the platform-level data model protocol and the management component transmission protocol and supports upgrade; Based on the target network card firmware, at least one target network card device that supports upgrading by using the target network card firmware is determined from the first network card devices.
3. The network card firmware upgrade method according to claim 2, characterized in that: The determining server supports both the platform-level data model protocol and the management component transmission protocol and supports the first network card device for upgrading, including: Determine from the transport layer a second network card device that supports the management component transport protocol; Obtain the message type supported by the second network card device; Determining whether the second network card device supports a platform-level data model protocol based on the message types supported by the second network card device; If the second network card device supports the platform-level data model protocol, determining that the second network card device is a third network card device that supports both the platform-level data model protocol and the management component transmission protocol; Determine whether the third network card device supports upgrading; If the third network card device supports upgrading, the third network card device is determined as the first network card device.
4. The network card firmware upgrade method according to claim 2, characterized in that: The step of determining, 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 device comprises: Based on the target network card firmware, determine information of the network card device supported by the target network card firmware; For any first network card device, obtaining a physical identifier of the first network card device; Determine whether the information of the network card device supported by the target network card firmware includes the physical identifier of the first network card device; If the information of the network card device supported by the target network card firmware includes the physical identifier of the first network card device, it is determined that the first network card device is a target network card device that supports upgrading using the target network card firmware.
5. The network card firmware upgrade method according to claim 2, characterized in that: The method further comprises: 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 transmission protocol and supports upgrading, performing a mutex lock operation on all network card devices in the server to prevent other threads from concurrently accessing all network card devices in the server; After determining the first network card device, a mutex release operation is performed on all network card devices in the server to allow other threads to access all network card devices in the server.
6. The network card firmware upgrade method according to claim 1, characterized in that: When any network card device to be upgraded represented by the network card upgrade requirement information belongs to the target network card device set, taking the network card device to be upgraded as the target network card device to be upgraded includes: For any network card device to be upgraded, determining 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; 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.
7. The network card firmware upgrade method according to claim 6, characterized in that: The method further comprises: If there is no 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 determined that the network card device to be upgraded does not belong to the target network card device set, and the target network card firmware cannot be used for upgrading, and the upgrade failure information is returned.
8. The network card firmware upgrade method according to claim 1, characterized in that: The step of upgrading the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware includes: Create a corresponding upgrade thread for each target network card device to be upgraded; The upgrade threads of the plurality of target network card devices to be upgraded are executed in parallel, and based on the target network card firmware, the network card firmware in the plurality of target network card devices to be upgraded are upgraded in parallel.
9. The network card firmware upgrade method according to claim 8, characterized in that: The method further comprises: The upgrade thread of each target network card device to be upgraded is set to a separated state.
10. The network card firmware upgrade method according to claim 1, characterized in that: The method further comprises: Performing an upgrade access to the target network card devices 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 has been completely upgraded; If the network card firmwares of all target network card devices to be upgraded are upgraded, the step of performing upgrade access to the target network card devices to be upgraded at intervals of the first preset time period is stopped, and upgrade completion information is returned.
11. The network card firmware upgrade method according to claim 10, characterized in that: The method further comprises: If the network card firmware of any target network card device to be upgraded has not been upgraded, the step of performing upgrade access to the target network card device to be upgraded at intervals of the first preset time period is continued until the network card firmware of all target network card devices to be upgraded are upgraded.
12. The network card firmware upgrade method according to claim 10, characterized in that: The method further comprises: Before executing the step of performing upgrade access to the target network card devices to be upgraded at intervals of the first preset time period to determine whether the network card firmware of all target network card devices to be upgraded have been completely upgraded, performing a mutex lock operation on all network card devices in the server to prevent other threads from concurrently accessing all network card devices in the server; When the network card firmware of all target network card devices to be upgraded are completely upgraded, a mutex release operation is performed on all network card devices in the server to allow other threads to access all network card devices in the server.
13. The network card firmware upgrade method according to claim 1, characterized in that: The method further comprises: When receiving the network card device change information sent by the transport layer, based on the network card device change information, the step of determining at least one target network card device that supports upgrading using the target network card firmware based on the target network card firmware is executed to update the target network card device set corresponding to the target network card firmware.
14. The network card firmware upgrade method according to claim 1, characterized in that: The method further comprises: At intervals of a second preset time period, for any target network card device to be upgraded, determining whether the network card firmware in the target network card device to be upgraded has been upgraded; If the network card firmware in the target network card device to be upgraded has not been upgraded, determining 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, the upgrade of the network card firmware in the target network card device to be upgraded is stopped, and it is determined that the upgrade of the network card firmware of the target network card device to be upgraded has failed.
15. The network card firmware upgrade method according to claim 14, characterized in that: The method further comprises: 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, the network card firmware in the target network card device to be upgraded continues to be upgraded.
16. The network card firmware upgrade method according to claim 1, characterized in that: The method further comprises: The upgrade execution information generated during the network card firmware upgrade process in the target network card device to be upgraded is recorded in a log.
17. A network card firmware upgrade device, characterized in that: Applicable to out-of-band processors, including: The acquisition module is used to obtain the target network card firmware; A first determination module is used 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, and obtain a target network card device set corresponding to the target network card firmware; A receiving module, used for receiving network card upgrade requirement information input by a user; A second determining module is used to, if 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; The upgrade module is used to upgrade the network card firmware in multiple target network card devices to be upgraded in parallel based on the target network card firmware.
18. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the network card firmware upgrade method as claimed in any one of claims 1 to 16 when executing the computer program.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the network card firmware upgrade method according to any one of claims 1 to 16.
20. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the network card firmware upgrade method according to any one of claims 1 to 16 are implemented.
Citation Information
Patent Citations
Firmware upgrading method and device
CN109189424A
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
Firmware upgrading method, firmware upgrading system and related equipment
CN119376752A
Drive upgrading method and device of magnetic levitation conveying system, computer equipment, readable storage medium and program product
CN119396436A