A method, device, equipment and storage medium for deploying configuration in firmware upgrade
Patent Information
- Application Number
- CN202310170996.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-02-27
AI Technical Summary
[0004]有鉴于此,本发明的目的在于提供一种固件升级中部署配置的方法、装置、设备及存储介质,解决了现有技术中固件升级过程中配置部署效率较低的技术问题
[0035] As can be seen, this invention obtains the queue corresponding to the firmware to be upgraded, performs queue emptying and queue suspension; stores the hardware state corresponding to the firmware to be upgraded; and restores the configuration of the firmware to be upgraded according to the hardware state when the firmware upgrade is completed. Compared with the current method that requires uninstalling drivers, migrating services, and redeploying configurations, this invention saves the hardware state before the upgrade, allowing for a brief pause in IO (Input/Output) processing during the firmware upgrade process, and automatically resuming IO after the upgrade. Throughout the entire upgrade process, services are not migrated and redeployment is not required. Therefore, the firmware upgrade deployment configuration method provided by this invention has higher upgrade efficiency and does not result in the loss of IP (Internet Protocol), MAC (Medium Access Control) address, and other configurations.
Smart Images

Figure CN116225495B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and in particular to a method, apparatus, device, and storage medium for deploying configurations during firmware upgrades. Background Technology
[0002] Hardware firmware upgrades are essential to support customer customization needs and bug fixes. Current hardware upgrade solutions from various vendors require uninstalling the driver before the upgrade, reinstalling the driver after the upgrade, launching the DPDK (DataPlane Development Kit) application, reconfiguring the device, enabling SR-IOV (single root input / output virtualization), and starting containers and virtual machines. This approach essentially requires customers to migrate their business processes, then migrate them back after the upgrade, and redeploy the business. Alternatively, after a firmware upgrade, the deployment configuration needs to be restarted to make the upgraded configuration take effect.
[0003] Therefore, the existing technology of migrating services away and then migrating them back or restarting them results in low configuration and deployment efficiency during firmware upgrades because it requires constant redeployment or restarting. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, device and storage medium for deploying configuration in firmware upgrade, which solves the technical problem of low configuration deployment efficiency in the firmware upgrade process in the prior art.
[0005] To address the aforementioned technical problems, this invention provides a method for deploying configurations during firmware upgrades, comprising:
[0006] Obtain the queue corresponding to the firmware to be upgraded, and empty and suspend the queue.
[0007] Store the hardware state corresponding to the firmware to be upgraded;
[0008] When the firmware upgrade is completed, the configuration of the firmware upgrade is restored according to the hardware status.
[0009] Optionally, before restoring the configuration of the firmware to be upgraded according to the hardware state after the firmware upgrade is completed, the method further includes:
[0010] Obtain the execution status of the firmware to be upgraded as polled;
[0011] The upgrade status of the firmware to be upgraded is determined based on the execution status.
[0012] Optionally, the process of emptying and suspending the queue includes:
[0013] The method for emptying and suspending the queue is determined based on the driver deployment level;
[0014] The queue is emptied and the queue is suspended in the manner described above.
[0015] Optionally, determining the queue emptying and queue suspension methods based on the driver deployment level includes:
[0016] Based on the aforementioned driver deployment level, the scenario is determined to be a virtual machine, container, or vDPA scenario;
[0017] When the scenario is the virtual machine or the container, after receiving the firmware upgrade message, the driver notification is blocked, and the queue is emptied and the queue is suspended.
[0018] When the scenario is the vDPA scenario, the driver notification is canceled, the hardware address mapping is passed through, the vDPA is notified not to process, and the queue is emptied and the queue is suspended.
[0019] Optionally, before obtaining the queue corresponding to the firmware to be upgraded, emptying the queue, and suspending the queue, the method further includes:
[0020] Obtain the encrypted firmware upgrade package;
[0021] The encrypted firmware upgrade package is decrypted using a decryption key to obtain the firmware upgrade package corresponding to the firmware to be upgraded, thereby completing the firmware upgrade operation.
[0022] Optionally, before obtaining the queue corresponding to the firmware to be upgraded, the method further includes:
[0023] When the upgrade method is determined to be remote upgrade, in response to the upgrade trigger signal initiated by the main control terminal, the corresponding upgrade firmware is downloaded from the main control terminal.
[0024] The present invention also provides an apparatus for deploying configurations during firmware upgrades, comprising:
[0025] The queue emptying and suspension module is used to obtain the queue corresponding to the firmware to be upgraded, and to empty and suspend the queue.
[0026] A hardware status acquisition module is used to acquire and store the hardware status corresponding to the firmware to be upgraded.
[0027] The recovery module is used to restore the configuration of the firmware to be upgraded according to the hardware status when the firmware upgrade is completed.
[0028] Optionally, the device for deploying the configuration during the firmware upgrade further includes:
[0029] A polling module is used to obtain the execution status of the firmware to be upgraded that has been polled.
[0030] The upgrade status determination module is used to determine the upgrade status of the firmware to be upgraded based on the execution status.
[0031] The present invention also provides a device for deploying configurations during firmware upgrades, comprising:
[0032] Memory, used to store computer programs;
[0033] A processor for executing the computer program to implement the steps of the deployment configuration method in the firmware upgrade described above.
[0034] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the deployment configuration method in the firmware upgrade described above.
[0035] As can be seen, this invention obtains the queue corresponding to the firmware to be upgraded, performs queue emptying and queue suspension; stores the hardware state corresponding to the firmware to be upgraded; and restores the configuration of the firmware to be upgraded according to the hardware state when the firmware upgrade is completed. Compared with the current method that requires uninstalling drivers, migrating services, and redeploying configurations, this invention saves the hardware state before the upgrade, allowing for a brief pause in IO (Input / Output) processing during the firmware upgrade process, and automatically resuming IO after the upgrade. Throughout the entire upgrade process, services are not migrated and redeployment is not required. Therefore, the firmware upgrade deployment configuration method provided by this invention has higher upgrade efficiency and does not result in the loss of IP (Internet Protocol), MAC (Medium Access Control) address, and other configurations.
[0036] In addition, the present invention also provides a device, equipment and storage medium for deploying configurations in firmware upgrades, which also have the above-mentioned beneficial effects. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0038] Figure 1A flowchart illustrating a method for deploying configuration during firmware upgrades, provided in an embodiment of the present invention;
[0039] Figure 2 A flowchart illustrating a method for deploying configuration during firmware upgrades, provided in an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of a firmware architecture provided for an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of a device for deploying and configuring firmware upgrades, provided in an embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram of the structure of a device deployed and configured during firmware upgrade, as provided in an embodiment of the present invention. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] The current hardware upgrade solutions from various manufacturers are as follows: Before the upgrade, the upgrade tool first saves the configuration space of the PCIe device (high-speed serial peripheral device); uninstalls the driver (if the PCIe device is bound to dpdk (Intel DataPlane Development Kit), it requires stopping dpdk-based programs); reloads the firmware; restores the configuration space of the PCIe device; and installs the driver. However, uninstalling the driver has significant drawbacks, as it can cause service interruptions for other PCIe devices not provided by this hardware in dpdk-based applications. If the PCIe device is bound to a container or passed through a VM (Virtual Machine), the PCIe device needs to exit the container and VM. After the upgrade, the container and VM need to be restarted, which will cause the loss of IP, MAC address, and other configurations. If SR-IOV (single root input / output virtualization) has been enabled, SR-IOV also needs to be re-enabled after the upgrade. This solution actually requires customers to migrate their business out, and then migrate it back after the upgrade is completed, and then redeploy the business.
[0045] In view of this, this patent proposes a method for deploying configuration during firmware upgrade. When performing firmware upgrade, the service does not need to be migrated, and the service is automatically restored after the upgrade is completed. Therefore, the upgrade efficiency and configuration recovery efficiency are higher.
[0046] The following is a detailed explanation of the process; please refer to it. Figure 1 , Figure 1 This is a flowchart illustrating a method for deploying configuration during firmware upgrades, provided by an embodiment of the present invention. The method may include:
[0047] S100 retrieves the queue corresponding to the firmware to be upgraded, and performs queue emptying and queue suspension.
[0048] This embodiment does not limit the specific execution entity, as long as it is the upgrade hardware corresponding to the firmware to be upgraded. For example, the execution entity could also be the hardware corresponding to a programmable SNIC (Smart Network Interface Card); or the firmware to be upgraded could also be the hardware corresponding to a DPU (Data Processing Unit). This embodiment does not limit the upgrade method for the firmware to be upgraded. For example, the firmware to be upgraded can be upgraded remotely; or it can be upgraded non-remotely. In this embodiment, the PF (Physical Device) can be used to notify the VF (Virtual Device) to perform queue emptying and suspension through the Mailbox device interaction mechanism provided by the hardware. This embodiment suspends business processing through queue draining, thereby storing the hardware state. The queue suspension in this embodiment is similar to a ready queue, and the suspended queue holds tasks waiting for kernel objects. This embodiment does not limit the steps of queue suspension and queue emptying. For example, in a Container and VM passthrough scenario, after receiving the upgrade preparation message, the VF VendorDriver blocks the Notify, emptys the queue and suspends the process, and no longer operates on hardware registers. Or, in a vDPA (virtio data path acceleration) scenario, the vDPA Driver removes the VM's Notify passthrough hardware address mapping. In this way, the VM's Notify will notify the vDPA Driver not to process the message via ioeventfd, and then emptys the queue and suspends the process.
[0049] S101 stores the hardware status corresponding to the firmware to be upgraded.
[0050] After emptying and suspending the queue, this embodiment can store the hardware state corresponding to the firmware to be upgraded. In this embodiment, the hardware state refers to the current service state and related configuration information corresponding to the firmware to be upgraded. It can be understood that VF saves the queue context (hardware state) so that configuration can be restored later based on this hardware state.
[0051] S102: When the firmware to be upgraded is completed, restore the configuration of the firmware to be upgraded according to the hardware status.
[0052] This embodiment restores the configuration of the firmware to be upgraded based on the hardware state when the firmware upgrade is completed. This embodiment does not limit the specific method for determining whether the firmware upgrade is complete. For example, it can be determined whether the firmware upgrade is complete by the new firmware content corresponding to the firmware; or it can be determined by the tag information corresponding to the firmware; or it can be determined by the upgrade field corresponding to the firmware. It is understood that after emptying and suspending the queue, the firmware can be loaded and upgraded. Once the firmware upgrade is complete, the hardware state of the upgraded firmware can be restored based on the previously stored hardware state. This embodiment does not limit the specific method for determining whether the firmware upgrade is complete. For example, it can be determined whether the firmware upgrade is complete by setting a field; or it can be determined by a firmware upgrade notification message.
[0053] Furthermore, to improve hardware state recovery and configuration efficiency, before restoring the configuration of the firmware to be upgraded based on the hardware state after the firmware upgrade is completed, the following may also be included:
[0054] Get the execution status of the polled firmware to be upgraded;
[0055] The upgrade status of the firmware to be upgraded is determined based on the execution status.
[0056] This embodiment continuously polls the execution status of the firmware to be upgraded to determine whether the upgrade is complete. Polling in this embodiment is a method used by the CPU (Central Processing Unit) to decide how to provide services to peripheral devices, also known as "Programmed I / O." The concept of polling is that the CPU periodically sends queries, sequentially asking each peripheral device whether it needs its service; if so, it provides the service, and after the service is completed, it queries the next peripheral device, and so on, continuously. In this embodiment, the execution status of the firmware to be upgraded refers to whether the upgrade process has been completed. It can be understood that polling can promptly detect whether the firmware upgrade is complete, thereby allowing for timely restoration of the hardware state and improving the speed of the entire firmware upgrade process.
[0057] Furthermore, to make queue emptying and queue suspension more accurate, the above-mentioned queue emptying and queue suspension processes can include:
[0058] Determine the methods for emptying and suspending queues based on the driver deployment level;
[0059] Emptying and suspending queues are done according to the specified methods.
[0060] In this embodiment, the driver deployment level refers to the location of the driver. Depending on the driver deployment level, the steps for emptying and suspending the queue differ; that is, the methods for emptying and suspending the queue vary. This embodiment does not limit the specific driver deployment level. For example, the driver deployment level could be where the driver directly controls the vDPA device; or where the driver directly controls the VM or container.
[0061] Furthermore, to ensure timely queue emptying and queue suspension, the queue emptying and suspension methods determined based on the driver deployment layer may include:
[0062] Based on the driver deployment level, determine whether the scenario is a virtual machine, container, or vDPA scenario;
[0063] When the scenario is a virtual machine or the container, after receiving the firmware upgrade message, the driver notification is blocked, and the queue is emptied and suspended.
[0064] When the scenario is a vDPA scenario, the driver notification is canceled, the hardware address mapping is passed through, the vDPA is notified not to process, and the queue is emptied and suspended.
[0065] In this embodiment, vDPA is an abbreviation for vhost datapath acceleration. It supports virtio ring compatible devices and can directly provide data path acceleration for virtio drivers. The reason why vDPA performs queue emptying and queue suspension differently from virtual machines and containers in this embodiment is because the data plane of vDPA is directly connected to the VM (virtual machine).
[0066] Furthermore, to improve the security of firmware upgrades, before obtaining the queue corresponding to the firmware to be upgraded, emptying the queue, and suspending the queue, the following may also be included:
[0067] Obtain the encrypted firmware upgrade package;
[0068] The encrypted firmware upgrade package is decrypted using the decryption key to obtain the firmware upgrade package corresponding to the firmware to be upgraded, thus completing the firmware upgrade operation.
[0069] In this embodiment, when upgrading and loading the firmware using a firmware upgrade package, an encrypted firmware upgrade package needs to be obtained to ensure the security of the firmware upgrade. This embodiment does not limit the specific encryption method corresponding to the encrypted firmware upgrade package. For example, the encryption method corresponding to the encrypted firmware upgrade package can be symmetric encryption; or the encryption method corresponding to the encrypted firmware upgrade package can also be asymmetric encryption. It is understood that after obtaining the encrypted firmware upgrade package, it will be decrypted to obtain the firmware upgrade package for upgrading the firmware to be upgraded.
[0070] Furthermore, to improve the diversity of firmware upgrades, before obtaining the queue corresponding to the firmware to be upgraded, the following may also be included:
[0071] When the upgrade method is determined to be remote upgrade, the corresponding upgrade firmware is downloaded from the main control terminal in response to the upgrade trigger signal initiated by the main control terminal.
[0072] This embodiment takes into account the possibility of needing remote upgrades. Therefore, when a remote upgrade is required, the corresponding upgrade firmware is downloaded from the main control terminal in response to the upgrade trigger signal initiated by the main control terminal.
[0073] The firmware upgrade deployment configuration method provided in this embodiment of the invention obtains the queue corresponding to the firmware to be upgraded, emptys the queue, and suspends the queue; stores the hardware state corresponding to the firmware to be upgraded; and restores the configuration of the firmware to be upgraded according to the hardware state when the firmware upgrade is completed. It can be seen that, compared with the current method which requires uninstalling the driver, migrating services, and redeploying, this invention saves the hardware state before the upgrade, allowing for a brief pause in I / O processing during the firmware upgrade process, and automatic resumption of I / O after the upgrade. Throughout the entire upgrade process, services are not migrated and redeployment is not required. Therefore, the firmware upgrade deployment configuration method provided by this invention has higher upgrade efficiency and does not result in the loss of IP, MAC address, and other configurations. Furthermore, the firmware upgrade status is obtained through polling. Since the client periodically sends requests to the server, and the server immediately returns a response and closes the connection upon receiving the request, the polling method has advantages such as simplicity, ease of implementation, and ease of control. Moreover, different queue emptying and queue suspension are determined based on different driver deployment levels, making queue emptying and suspension more accurate. Furthermore, specific steps are determined according to the driver deployment level to ensure timely queue emptying and suspension. Additionally, the firmware upgrade package is encrypted, improving the security of device firmware upgrades. Finally, firmware can be upgraded remotely, increasing the diversity of firmware upgrades.
[0074] For a clearer understanding of this invention, please refer to the following details. Figure 2 , Figure 2 This is a flowchart illustrating a method for deploying and configuring firmware during an upgrade, as provided in an embodiment of the present invention. The firmware framework used in this flowchart is as follows: Figure 3 As shown, Figure 3 This invention provides a schematic diagram of a firmware architecture, and a method for deploying configuration during firmware upgrades may specifically include:
[0075] S200, saves the configuration space of PCIe devices before firmware upgrade.
[0076] In this embodiment, the Upgrade App begins firmware flashing; the Upgrade App saves the configuration space of the PCIe device. This embodiment requires saving the configuration space of the PCIe (PCI-Express, Serial Peripheral Device). Figure 3In this context, HOST refers to a server, HW represents firmware, PF stands for physical device, VF stands for virtual device, MailboxRoute andForward refers to mailbox routing and forwarding, User is user-space, Kernel is kernel-space, PF VendorDriver is a vendor driver, VFIO (Virtual Function I / O) driver framework is a user-space driver framework, ContainerNamespace is container space, DPDK (Data Plane Development Kit) is a data plane development kit, UDS (Unified Diagnostic Services) is a diagnostic communication method, Qemu is a simulated processor, and VFVendorDriver is a packet search queue driver.
[0077] S201 notifies the physical device manufacturer to prepare for firmware upgrades through the user-mode and kernel-mode interaction mechanism, and then polls and waits for the status of PF.
[0078] This embodiment uses user-space and kernel-space interaction mechanisms such as sysfs (file system), degbugfs (debugfs virtual file system for kernel debugging), ioctl (device control interface function in device driver), and netlink (socket) to notify the PF VendorDriver (physical device vendor driver) to prepare for firmware hot upgrade, and then polls and waits for the PF's status to complete the firmware upgrade loading.
[0079] S202, through PF, notifies VF to empty and suspend the queue through the device interaction mechanism provided by the hardware; and saves the queue context (hardware state), and PF completes the preparation before upgrade.
[0080] This embodiment handles queue emptying and queue suspension in two main ways. First, for Container and VM passthrough scenarios, after receiving the (upgrade preparation) message, the VF Vendor Driver blocks the Notify (driver notification), emptys and suspends the queue, and no longer operates on hardware registers. Second, for vDPA (virtio datapathacceleration) scenarios, the vDPA Driver removes the VM's Notify passthrough hardware address mapping. Thus, the VM's Notify (driver notification) will notify the vDPA Driver (Virtual datapathacceleration) via ioeventfd. The vDPA Driver does not process this and then emptys and suspends the queue.
[0081] S203, after polling and finding that PF has completed the upgrade preparations, begins loading the firmware.
[0082] In this embodiment, the VF saves the queue context (hardware state), replies with an ACK to the PF via the Mailbox, resets the Mailbox queue, enters Mailbox RQ Poll mode, and waits for the PF to notify that the firmware upgrade is complete. In this embodiment, after the PF (physical device) empties and suspends the queue, it saves the queue context (hardware state), and the PF completes its pre-upgrade preparations.
[0083] S204, polling until firmware loading is complete, PCIe device completes physical layer retraining, and restores PCIe device configuration space.
[0084] In this embodiment, the Upgrade App polls the DLActive field in the LinkStat (server startup) of the PCIe Capability in the PF PCIe device configuration space and finds it set, indicating that the firmware reload is complete and the hardware PCIe has completed physical layer retraining.
[0085] S205 notifies PF that the firmware upgrade is complete and polls PF's status, waiting for the hardware status to be restored.
[0086] In this embodiment, the Upgrade App notifies the PF that the firmware upgrade is complete and polls the PF's status. The Upgrade App restores the PCIe device's configuration space and waits for the restoration to complete.
[0087] S206, notify PF to configure and enable the device interaction mechanism queue between PF and VF, and restore hardware state.
[0088] S207 notifies PF to restore configuration, re-enters driver notification for queue, restores IO, and finally sets the service restoration complete.
[0089] In this embodiment, the PF recovery is completed by polling until the firmware upgrade is finished.
[0090] The following describes an apparatus for deploying and configuring firmware upgrades according to an embodiment of the present invention. The apparatus for deploying and configuring firmware upgrades described below and the method for deploying and configuring firmware upgrades described above can be referred to in correspondence with each other.
[0091] Please refer to the details. Figure 4 , Figure 4 A schematic diagram of a device for deploying and configuring firmware upgrades, provided in an embodiment of the present invention, may include:
[0092] The queue emptying and suspension module 100 is used to obtain the queue corresponding to the firmware to be upgraded, and to empty and suspend the queue.
[0093] The hardware status acquisition module 200 is used to acquire and store the hardware status corresponding to the firmware to be upgraded.
[0094] The recovery module 300 is used to restore the configuration of the firmware to be upgraded according to the hardware status when the firmware upgrade is completed.
[0095] Furthermore, based on the above embodiments, the device for deployment and configuration in the above firmware upgrade may further include:
[0096] A polling module is used to obtain the execution status of the firmware to be upgraded that has been polled.
[0097] The upgrade status determination module is used to determine the upgrade status of the firmware to be upgraded based on the execution status.
[0098] Furthermore, based on any of the above embodiments, the queue emptying and suspending module 100 may include:
[0099] The queue emptying and suspension method determination unit is used to determine the queue emptying and queue suspension methods according to the driver deployment level;
[0100] The queue emptying and suspending unit is used to empty the queue and suspend the queue in the manner described above.
[0101] Furthermore, based on the above embodiments, the queue emptying and suspension method determination unit may include:
[0102] The scenario determination subunit is used to determine whether the scenario is a virtual machine, container, or vDPA scenario based on the driver deployment layer.
[0103] The first sub-unit for determining the emptying and suspension methods is used to block driver notifications and perform queue emptying and queue suspension when the scenario is the virtual machine or the container and a firmware upgrade message is received.
[0104] When the scenario is the vDPA scenario, the second sub-unit determines the emptying and suspension method by canceling the driver notification, passing through the hardware address mapping, notifying vDPA not to process, and performing queue emptying and queue suspension.
[0105] Furthermore, based on any of the above embodiments, the device for deployment and configuration in the above firmware upgrade may further include:
[0106] Firmware upgrade package acquisition module, used to acquire encrypted firmware upgrade packages;
[0107] The firmware upgrade package decryption module is used to decrypt the encrypted firmware upgrade package using a decryption key to obtain the firmware upgrade package corresponding to the firmware to be upgraded, so as to complete the firmware upgrade operation.
[0108] Furthermore, based on the above embodiments, the device for deployment and configuration in the above firmware upgrade may further include:
[0109] The remote firmware upgrade module is used to download the corresponding upgrade firmware from the main control terminal in response to the upgrade trigger signal initiated by the main control terminal when the upgrade method is determined to be remote upgrade.
[0110] It should be noted that the order of modules and units in the device deployed and configured in the above firmware upgrade can be changed without affecting the logic.
[0111] The firmware upgrade deployment and configuration apparatus provided in this embodiment of the invention includes: a queue emptying and suspension module 100, used to acquire a queue corresponding to the firmware to be upgraded, and to empty and suspend the queue; a hardware status acquisition module 200, used to acquire and store the hardware status corresponding to the firmware to be upgraded; and a recovery module 300, used to restore the configuration of the firmware to be upgraded according to the hardware status when the firmware upgrade is completed. It can be seen that, compared with the current method which requires uninstalling drivers, migrating services, and redeploying, this invention saves the hardware status before the upgrade, allowing for a brief pause in IO processing during the firmware upgrade process, and automatic resumption of IO after the upgrade. Throughout the upgrade process, services are not migrated and redeployment is not required. Therefore, the firmware upgrade deployment and configuration method provided by this invention has higher upgrade efficiency and does not result in the loss of IP, MAC address, and other configurations. Furthermore, the firmware upgrade status is obtained through polling. Since the client periodically sends requests to the server, and the server immediately returns a response and closes the connection upon receiving the request, the polling method has advantages such as simplicity, ease of implementation, and ease of control. Moreover, different queue emptying and queue suspension are determined based on different driver deployment levels, making queue emptying and suspension more accurate. Furthermore, specific steps are determined according to the driver deployment level to ensure timely queue emptying and suspension. Additionally, the firmware upgrade package is encrypted, improving the security of device firmware upgrades. Finally, firmware can be upgraded remotely, increasing the diversity of firmware upgrades.
[0112] The following describes a device deployed and configured in a firmware upgrade according to an embodiment of the present invention. The device deployed and configured in the firmware upgrade described below can be referred to in correspondence with the method deployed and configured in the firmware upgrade described above.
[0113] Please refer to Figure 5 , Figure 5A schematic diagram of the structure of a device deployed and configured in a firmware upgrade according to an embodiment of the present invention may include:
[0114] Memory 10 is used to store computer programs;
[0115] Processor 20 is used to execute computer programs to implement the steps of the deployment configuration method described above in the firmware upgrade.
[0116] The memory 10, processor 20, and communication interface 31 all communicate with each other through the communication bus 32.
[0117] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment of the invention, the memory 10 may store programs for implementing the following functions:
[0118] Obtain the queue corresponding to the firmware to be upgraded, and empty and suspend the queue.
[0119] Stores the hardware status corresponding to the firmware to be upgraded;
[0120] When the firmware upgrade is complete, restore the configuration of the firmware to be upgraded according to the hardware status.
[0121] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.
[0122] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.
[0123] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.
[0124] Communication interface 31 can be an interface for the communication module, used to connect with other devices or systems.
[0125] Of course, it should be noted that, Figure 5 The structure shown does not constitute a limitation on the devices deployed and configured in firmware upgrades in the embodiments of the present invention. In practical applications, the devices deployed and configured in firmware upgrades may include more than [other devices]. Figure 5 More or fewer components as shown, or combinations of certain components.
[0126] The following describes the computer-readable storage medium provided in the embodiments of the present invention. The computer-readable storage medium described below can be referred to in correspondence with the deployment and configuration method in firmware upgrade described above.
[0127] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the deployment configuration method described above in the firmware upgrade.
[0128] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0129] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0130] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0131] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0132] The above provides a detailed description of the method, apparatus, device, and storage medium for deployment and configuration in firmware upgrades provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for deploying configuration during firmware upgrade, characterized in that, include: Before firmware upgrade, save the configuration space of the PCIe device; The user-space and kernel-space interaction mechanism is used to notify the PF Vendor Driver to prepare for firmware hot upgrade and to poll and wait for the status of the PF. Obtain the queue corresponding to the firmware to be upgraded, and notify VF through PF to empty and suspend the queue through the hardware-provided Mailbox device interaction mechanism; Store the hardware state corresponding to the firmware to be upgraded; wherein, the hardware state includes the current service state and related configuration information corresponding to the firmware to be upgraded; use the queue context saved by VF as the hardware state, reply ACK to PF through Mailbox, reset Mailbox queue, enter Mailbox RQ Poll mode, and wait for PF to notify that the firmware upgrade is complete; When the firmware upgrade is completed, the configuration of the firmware upgrade is restored according to the hardware status; When the firmware upgrade is completed, the configuration of the firmware to be upgraded is restored according to the hardware status, including: when the DLActive field in LinkStat of PCIe Capability in the PF PCIe device configuration space is set, it is determined that the firmware loading is complete and the PCIe device has completed physical layer retraining, and the configuration space of the PCIe device is restored; the PF is notified to configure and enable the device interaction mechanism queue between the PF and VF, and the hardware status is restored; the PF is notified to perform configuration restoration, and the driver notification in the queue is re-entered, IO is restored, and the service restoration is set to complete. This includes emptying and suspending queues, among other things: Based on the driver deployment level, determine whether the scenario is a virtual machine, container, or vDPA scenario; When the scenario is the virtual machine or the container, after receiving the firmware upgrade message, the driver notification is blocked, and the queue is emptied and the queue is suspended. When the scenario is the vDPA scenario, the driver notification is canceled, the hardware address mapping is passed through, the vDPA is notified not to process, and the queue is emptied and the queue is suspended.
2. The method for deploying configuration in firmware upgrade according to claim 1, characterized in that, Before restoring the configuration of the firmware to be upgraded according to the hardware state when the firmware upgrade is completed, the method further includes: Obtain the execution status of the firmware to be upgraded as polled; The upgrade status of the firmware to be upgraded is determined based on the execution status.
3. The method for deploying configuration in firmware upgrade according to any one of claims 1 to 2, characterized in that, Before obtaining the queue corresponding to the firmware to be upgraded, emptying the queue, and suspending the queue, the process also includes: Obtain the encrypted firmware upgrade package; The encrypted firmware upgrade package is decrypted using a decryption key to obtain the firmware upgrade package corresponding to the firmware to be upgraded, thereby completing the firmware upgrade operation.
4. The method for deploying and configuring firmware upgrades according to claim 1, characterized in that, Before obtaining the queue corresponding to the firmware to be upgraded, the following steps are also included: When the upgrade method is determined to be remote upgrade, in response to the upgrade trigger signal initiated by the main control terminal, the corresponding upgrade firmware is downloaded from the main control terminal.
5. An apparatus for deploying configurations during firmware upgrades, characterized in that, The method for deploying configuration in firmware upgrade according to any one of claims 1 to 4 includes: The queue emptying and suspension module is used to obtain the queue corresponding to the firmware to be upgraded, and to empty and suspend the queue. A hardware status acquisition module is used to acquire and store the hardware status corresponding to the firmware to be upgraded. The recovery module is used to restore the configuration of the firmware to be upgraded according to the hardware status when the firmware upgrade is completed.
6. The apparatus for deploying and configuring firmware upgrades according to claim 5, characterized in that, The device deployed and configured in the firmware upgrade also includes: A polling module is used to obtain the execution status of the firmware to be upgraded that has been polled. The upgrade status determination module is used to determine the upgrade status of the firmware to be upgraded based on the execution status.
7. A device for deployment and configuration during firmware upgrades, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method for deploying configuration in firmware upgrade as described in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the deployment configuration method in firmware upgrade as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Firmware upgrading method and device
CN110704091A