Method and apparatus for controlling ethernet IP accelerator, and device and medium
By coordinating operations between user mode and kernel mode and utilizing Ethernet power management processes and state change events, the functional failure of Ethernet network hardware accelerators during system hibernation and wake-up processes was resolved, achieving higher communication rates and lower CPU overhead, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- FIBOCOM AUTO SOFTWARE INC
- Filing Date
- 2025-04-29
- Publication Date
- 2026-05-21
AI Technical Summary
Frequently turning the Ethernet network hardware accelerator on and off during system hibernation and wake-up can cause functional failures, increase device power consumption and CPU overhead, and negatively impact user experience.
The user-mode preset process writes flag information to the file node of the Ethernet network hardware accelerator, and the kernel-mode driver opens or closes the Ethernet network hardware accelerator based on the flag information. Combined with state change events and work queue management, the Ethernet power management process monitors the system status to ensure the reliability of the Ethernet network hardware accelerator.
It improves Ethernet communication speed, reduces CPU overhead, and enhances user experience, especially in 5G communication module CPE products, significantly improving communication speed and reducing system power consumption.
Smart Images

Figure CN2025092023_21052026_PF_FP_ABST
Abstract
Description
Ethernet network hardware accelerator control methods, devices, equipment and media
[0001] Citation of relevant applications
[0002] This disclosure claims the entire benefits of Chinese Patent Application No. 202411624141.0, filed on November 14, 2024, with the State Intellectual Property Office of the People's Republic of China, entitled "A Control Method, Apparatus, Device and Medium for an Ethernet Network Hardware Accelerator", the entire contents of which are incorporated herein by reference.
[0003] field
[0004] This disclosure generally relates to the field of communication technology, and more specifically to methods, apparatus, devices and media for controlling Ethernet network hardware accelerators.
[0005] background
[0006] IPA (IP accelerator, network hardware accelerator) is an on-chip network-independent hardware accelerator. Ethernet IPA is a submodule of IPA, specifically designed to process network packets from Ethernet devices. In scenarios where device power consumption is highly sensitive, the Ethernet IPA channel needs to be disabled when the system is in sleep mode, and enabled when the system wakes up.
[0007] Currently, during system operation, the Ethernet IPA is frequently turned on and off, which can easily lead to its malfunction. When the system is in sleep mode, the Ethernet IPA fails, preventing the system from sleeping and causing excessive power consumption. Upon waking, the Ethernet IPA also fails, resulting in slow Ethernet communication, increased CPU (Central Processing Unit) overhead, and a negative impact on user experience.
[0008] Overview
[0009] In a first aspect, this disclosure provides a method for controlling an Ethernet network hardware accelerator, comprising:
[0010] In response to operating system hibernation or wake-up operations, a preset process in user mode writes flag information to the file node corresponding to the Ethernet network hardware accelerator. The flag information includes a first preset value and a second preset value. The first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off; the second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on.
[0011] The Ethernet network hardware accelerator is turned on or off based on the flag information via the kernel-mode network hardware accelerator driver.
[0012] In some implementations, the step of turning the Ethernet network hardware accelerator on or off based on the flag information via a kernel-mode network hardware accelerator driver includes:
[0013] Through the kernel-mode network hardware accelerator driver, the first control job corresponding to the Ethernet network hardware accelerator is added to the work queue based on the flag information; and
[0014] When the operating system schedules the work queue, it turns the Ethernet network hardware accelerator on or off based on the first control operation.
[0015] In some implementations, turning the Ethernet network hardware accelerator on or off based on the first control operation includes:
[0016] Based on the first control operation trigger callback function, the Ethernet network hardware accelerator is turned on or off through the callback function.
[0017] In some implementations, the Ethernet network hardware accelerator control method further includes:
[0018] Monitor state change events, wherein the state change event is an event triggered when the connection state of the Ethernet physical layer chip changes;
[0019] Based on the state change event, add the second control task corresponding to the Ethernet network hardware accelerator to the work queue; and
[0020] When the operating system schedules the work queue, it turns the Ethernet network hardware accelerator on or off based on the second control operation.
[0021] In some implementations, when the state change event corresponds to a connection establishment event, before turning on the Ethernet network hardware accelerator based on the second control operation, the following steps are further included:
[0022] Determine whether the Ethernet physical layer chip is in a connection establishment state;
[0023] If the Ethernet physical layer chip is in a connection establishment state, the Ethernet network hardware accelerator will be turned on based on the second control operation.
[0024] In some implementations, the preset process is an Ethernet power management process, and the Ethernet network hardware accelerator control method further includes:
[0025] The Ethernet power management process monitors the operating system's hibernation or wake-up operations.
[0026] In some implementations, the Ethernet network hardware accelerator control method further includes:
[0027] In response to the operating system booting up, the file node is created by the network hardware accelerator driver, wherein the file node persists even when the Ethernet card is turned off.
[0028] Secondly, this disclosure provides an Ethernet network hardware accelerator control device, which includes:
[0029] In response to operating system hibernation or wake-up operations, a preset process in user mode writes flag information to the file node corresponding to the Ethernet network hardware accelerator. The flag information includes a first preset value and a second preset value. The first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off; the second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on.
[0030] The Ethernet network hardware accelerator is turned on or off based on the flag information via the kernel-mode network hardware accelerator driver.
[0031] Thirdly, this disclosure provides an electronic device, including a memory and a processor, wherein:
[0032] The memory is configured to store computer programs;
[0033] The processor is configured to execute the computer program to implement the Ethernet network hardware accelerator control method described in this disclosure.
[0034] Fourthly, this disclosure provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the Ethernet network hardware accelerator control method described in this disclosure.
[0035] In some implementations, when the operating system sleeps or wakes up, a user-mode preset process and the kernel-mode network hardware accelerator driver interact based on the file node corresponding to the Ethernet network hardware accelerator. The user-mode preset process writes flag information indicating whether the operating system is sleeping or waking up, and whether the Ethernet network hardware accelerator needs to be turned on or off, into the file node. The kernel-mode network hardware accelerator driver then turns the Ethernet network hardware accelerator on or off based on the flag information. In this way, by actively manipulating the file node corresponding to the Ethernet network hardware accelerator through the user-mode process when the operating system sleeps or wakes up, the opening or closing of the Ethernet network hardware accelerator is achieved. This avoids frequent system sleeps and wake-ups, preventing the Ethernet network hardware accelerator application service process from failing to receive a wake-up event, which could lead to the Ethernet network hardware accelerator malfunction. This ensures the reliability of the Ethernet network hardware accelerator, thereby improving Ethernet communication speed, reducing CPU overhead, and enhancing user experience.
[0036] Brief description of the attached figures
[0037] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0038] Figure 1 is a flowchart of an Ethernet network hardware accelerator control method provided in an embodiment of this disclosure;
[0039] Figure 2 is a control flowchart of an Ethernet network hardware accelerator provided in an embodiment of this disclosure;
[0040] Figure 3 is a schematic diagram of the structure of an Ethernet network hardware accelerator control device according to an embodiment of the present disclosure; and
[0041] Figure 4 is a structural diagram of an electronic device provided in an embodiment of this disclosure.
[0042] Detailed Explanation
[0043] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this disclosure.
[0044] IPA stands for System-on-Chip Network Independent Hardware Accelerator. It can directly transfer network data between Ethernet, Modem, and USB (Universal Serial Bus) without direct CPU involvement, enabling direct access between memory spaces. Ethernet IPA is a submodule of IPA specifically designed to handle network packets from Ethernet devices. When network packets from the peer device are transmitted to the module via the Ethernet PHY (Physical Layer) chip, the data link layer (TCP / IP network model) receives the network packets and can then transmit them to the Modem through the Ethernet IPA channel.
[0045] As a hardware module unit within the CPU, the Ethernet IPA (Internet Protocol Access Provider) is crucial in power-sensitive scenarios. During system hibernation, the Ethernet IPA channel must be disabled; upon system wake-up, it must be enabled. Frequent hibernation and wake-up cycles during system operation can lead to Ethernet IPA malfunction if the IPA application service process does not receive a wake-up event. Thus, frequent opening and closing of the Ethernet IPA can easily cause it to fail. When the system is in hibernation, the Ethernet IPA malfunction prevents hibernation, resulting in excessive power consumption. Upon wake-up, the Ethernet IPA malfunction slows Ethernet communication, increases CPU overhead, and negatively impacts user experience. Therefore, this disclosure provides an Ethernet network hardware accelerator control scheme that ensures the reliability of the Ethernet network hardware accelerator, thereby improving Ethernet communication speed, reducing CPU overhead, and enhancing user experience.
[0046] Referring to Figure 1, one embodiment of this disclosure discloses a method for controlling an Ethernet network hardware accelerator, characterized by comprising:
[0047] Step S11: In response to the operating system's hibernation or wake-up operation, a preset process in user mode writes flag information to the file node corresponding to the Ethernet network hardware accelerator. The flag information includes a first preset value and a second preset value. The first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off. The second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on.
[0048] Step S12: Drive the network hardware accelerator in kernel mode and turn the Ethernet network hardware accelerator on or off based on the flag information.
[0049] In some implementations, operating system hibernation involves saving the currently running programs to the hard drive and then cutting off all power. Operating system wake-up is the process of reactivating the operating system from hibernation or sleep and restoring it to normal operation. Operating system hibernation can be understood as the operation that controls the operating system to enter hibernation, and operating system wake-up can be understood as the operation that wakes the operating system. User mode and kernel mode represent different privilege levels during program execution in a computer operating system. User mode is the state in which an application runs. In user mode, programs can only access limited computer resources and cannot execute privileged instructions. A preset process in user mode can be understood as a user-mode process capable of monitoring the operating system's hibernation or wake-up operations. Embodiments of this disclosure can use a preset process to monitor the various steps and state changes during the operating system's hibernation and wake-up processes to determine whether the operating system is about to enter hibernation or be woken up.
[0050] In some implementations, the preset process is an Ethernet power management process, which can monitor the operating system's sleep or wake-up operations. The Ethernet power management process can be understood as a dedicated Ethernet process for power management. Sleep and wake-up are two crucial aspects of computer power management; the Ethernet power management process effectively manages the system's power status, improving system energy efficiency and user experience.
[0051] In some implementations, the file node is created via the network hardware accelerator driver in response to the operating system booting up, and the file node persists even when the Ethernet card is off. The network hardware accelerator driver can be understood as the driver program corresponding to the Ethernet network hardware accelerator.
[0052] In some implementations, the file node of the Ethernet network hardware accelerator is deleted when the network interface card (NIC) (eth0) is turned off. When the NIC is turned on, the creation of the file node depends on the linkage (connection establishment) status of the PHY (i.e., the Ethernet physical layer chip). If the PHY is not linked, file node creation fails, causing the application process to lose its IPA file section functionality. This embodiment disables the deletion of the Ethernet network hardware accelerator's file node when the gateway is turned off, ensuring that the file node persists even when the Ethernet NIC is turned off, thus preventing the deletion of the Ethernet network hardware accelerator's file node when the NIC is turned off and avoiding the resulting IPA file section functionality failure.
[0053] In some implementations, the flag information can be understood as information that can characterize the sleep or wake-up state of the operating system, and the first preset value and the second preset value are different values, for example, the first preset value is 1 and the second preset value is 0.
[0054] In some implementations, kernel mode is the privileged state of the operating system, where the operating system kernel code runs. Kernel mode is the core part of the operating system that implements its functions and provides services, managing the system's hardware and software resources and ensuring the system's security and stability.
[0055] In some implementations, a kernel-mode network hardware accelerator driver can add a first control task corresponding to the Ethernet network hardware accelerator to a work queue based on the flag information; when the operating system schedules the work queue, it can turn the Ethernet network hardware accelerator on or off based on the first control task.
[0056] In some implementations, the work queue can be initialized by a network hardware accelerator driver. In this embodiment, the network hardware accelerator driver can be loaded in response to the operating system booting up, and the file node and work queue can be created and initialized through the network hardware accelerator driver.
[0057] In some implementations, a callback function can be triggered based on the first control action, and the Ethernet network hardware accelerator can be turned on or off through the callback function. In this embodiment, a corresponding worker thread can be created based on the first control action, and the worker thread can be used to trigger the callback function, which in turn turns the Ethernet network hardware accelerator on or off.
[0058] In some implementations, this disclosure can also monitor state change events, wherein the state change event is an event triggered when the connection state of the Ethernet physical layer chip changes; based on the state change event, a second control task corresponding to the Ethernet network hardware accelerator is added to the work queue; when the operating system schedules the work queue, the Ethernet network hardware accelerator is turned on or off based on the second control task.
[0059] In some implementations, a state change event can be triggered by the driver of the Ethernet physical layer chip when the connection state of the Ethernet physical layer chip changes. The connection state of the Ethernet physical layer chip, i.e. the connection state of the physical layer, can include the connection establishment state and the connection port state. Correspondingly, the state change event can include the connection establishment event and the connection disconnection event. The network hardware accelerator driver can monitor the state change event and add the second control task corresponding to the Ethernet network hardware accelerator to the work queue based on the state change event.
[0060] In some implementations, a state change event is triggered when the connection state of the Ethernet physical layer chip changes. This adds the corresponding second control operation for the Ethernet network hardware accelerator to the work queue, enabling the Ethernet network hardware accelerator to be turned on or off. In this way, turning the Ethernet network hardware accelerator on or off based on the connection state of the Ethernet physical layer chip makes the on / off of the Ethernet network hardware accelerator more in line with actual needs, further ensuring the reliability of the Ethernet network hardware accelerator, thereby improving the Ethernet communication rate, reducing CPU overhead, and enhancing the user experience.
[0061] In some implementations, when the state change event is a connection establishment event, before turning on the Ethernet network hardware accelerator based on the second control operation, it can also be determined whether the Ethernet physical layer chip is in a connection establishment state; if the Ethernet physical layer chip is in a connection establishment state, then the Ethernet network hardware accelerator is turned on based on the second control operation.
[0062] In this embodiment of the disclosure, when the state change event is the event corresponding to connection establishment, the connection status of the Ethernet physical layer chip is determined before the Ethernet network hardware accelerator is turned on. If the Ethernet physical layer chip is in the connection establishment state, the Ethernet network hardware accelerator is turned on. This ensures that the Ethernet network hardware accelerator is turned on when the Ethernet physical layer chip is in the connection establishment state, and avoids the increased power consumption caused by turning on the Ethernet network hardware accelerator when the Ethernet physical layer chip is disconnected.
[0063] In some implementations, when the operating system sleeps or wakes up, a user-mode preset process and the kernel-mode network hardware accelerator driver interact based on the file node corresponding to the Ethernet network hardware accelerator. The user-mode preset process writes flag information indicating whether the operating system is sleeping or waking up, and whether the Ethernet network hardware accelerator needs to be turned on or off, into the file node. The kernel-mode network hardware accelerator driver then turns the Ethernet network hardware accelerator on or off based on the flag information. In this way, by actively manipulating the file node corresponding to the Ethernet network hardware accelerator through the user-mode process when the operating system sleeps or wakes up, the opening or closing of the Ethernet network hardware accelerator is achieved. This avoids frequent system sleeps and wake-ups, preventing the Ethernet network hardware accelerator application service process from failing to receive a wake-up event, which could lead to the Ethernet network hardware accelerator malfunction. This ensures the reliability of the Ethernet network hardware accelerator, thereby improving Ethernet communication speed, reducing CPU overhead, and enhancing user experience.
[0064] Referring to Figure 2, Figure 2 is a control flowchart of an Ethernet network hardware accelerator provided in an embodiment of this disclosure.
[0065] When the system boots up and the IPA driver loads, it creates a file node corresponding to the Ethernet IPA, denoted as the IPA file node, and initializes a workqueue. Once created, the IPA file node persists and is not deleted even when the network interface (eth0) is shut down. The workqueue is a general mechanism for kernel threads to asynchronously execute work tasks.
[0066] When the PHY's link state changes, a `netdev_change` event (i.e., a state change event) is triggered. The IPA driver adds the Ethernet IPA's work (i.e., control work) to the workqueue. When the system schedules the workqueue, it triggers the work callback function, and then opens or closes the Ethernet IPA based on the PHY's link state. It can determine if it's a `LINK UP` event. If it is, the Ethernet IPA is opened based on the work thread. Before opening the Ethernet IPA based on the work thread, it checks if the PHY's state is `LINK UP`; if so, the Ethernet IPA is opened. If it's not a `LINK UP` event, the Ethernet IPA is closed based on the work thread.
[0067] When the system is in hibernation, the Ethernet power management process (i.e., the power_mgr process) operates the IPA file node to close the Ethernet IPA channel. When the system wakes up, the Ethernet power management process operates the IPA file node to open the Ethernet IPA channel. Specifically, when the system needs to enter hibernation, the power_mgr process writes a 1 to the IPA file node. The IPA driver adds the Ethernet IPA work queue to the workqueue. When scheduling the workqueue, the Ethernet IPA is closed based on the work thread, and the system enters hibernation. When the system wakes up, the power_mgr process writes a 0 to the IPA file node. The IPA driver adds the Ethernet IPA work queue to the workqueue. When scheduling the workqueue, the Ethernet IPA is opened based on the work thread. Before opening the Ethernet IPA based on the work thread, it checks whether the PHY status is LINK UP; if so, the Ethernet IPA is opened.
[0068] In some implementations, when the system boots up and the IPA driver loads, it creates an IPA file node and initializes a workqueue. When the PHY link state changes, a `netdew_change` event is triggered to enable or disable the IPA. When the system is in sleep mode, the Ethernet power management process actively disables the IPA; upon system wake-up, it actively enables the IPA.
[0069] In this way, the Ethernet IPA file node will still exist even after the network interface card (eth0) is turned off, preventing application processes from failing to read or write to the IPA file node. Frequent system hibernation and wake-up will not result in the Ethernet IPA function failing to work, nor will the inability to hibernate lead to excessive power consumption. This reduces CPU overhead and improves the user experience. Appropriate improvements to the original Ethernet IPA framework ensure that the Ethernet IPA remains highly stable and reliable even under frequent on / off scenarios.
[0070] This disclosure provides an Ethernet IPA management and control scheme to solve the problem of Ethernet IPA function failure caused by frequent sleep / wake cycles, thereby improving Ethernet communication speed, reducing CPU overhead, and enhancing user experience. For example, in a 5G (5th Generation Mobile Communication Technology) communication module CPE (Customer Premise Equipment) product, after using the solution provided in this disclosure, the Ethernet communication speed was significantly improved, and the system CPU overhead was reduced. There are significant improvements in functional integrity and performance, resulting in a better user experience.
[0071] Referring to Figure 3, one embodiment of this disclosure provides an Ethernet network hardware accelerator control device, including:
[0072] The file node operation module 11 is configured to respond to the operating system's hibernation or wake-up operation by writing flag information into the file node corresponding to the Ethernet network hardware accelerator through a user-mode preset process. The flag information includes a first preset value and a second preset value. The first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off. The second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on.
[0073] Accelerator control module 12 is configured to turn the Ethernet network hardware accelerator on or off based on the flag information via a kernel-mode network hardware accelerator driver.
[0074] In some implementations, the accelerator control module 12 includes:
[0075] The queue addition submodule is configured to add the first control job corresponding to the Ethernet network hardware accelerator to the work queue based on the flag information, through the kernel-mode network hardware accelerator driver.
[0076] The accelerator control submodule is configured to turn the Ethernet network hardware accelerator on or off based on the first control operation when the operating system schedules the work queue.
[0077] In some implementations, the accelerator control submodule is configured to trigger a callback function based on the first control action, and to turn the Ethernet network hardware accelerator on or off through the callback function.
[0078] In some embodiments, the apparatus may further include:
[0079] A state change event monitoring module is configured to monitor state change events, wherein the state change event is an event triggered when the connection state of the Ethernet physical layer chip changes;
[0080] Correspondingly, the queue addition submodule is also configured to add the second control task corresponding to the Ethernet network hardware accelerator to the work queue based on the state change event. The accelerator control submodule is also configured to turn the Ethernet network hardware accelerator on or off based on the second control task when the operating system schedules the work queue.
[0081] In some implementations, the accelerator control submodule further includes a connection status determination unit, configured to determine whether the Ethernet physical layer chip is in a connection establishment state before turning on the Ethernet network hardware accelerator based on the second control operation when the status change event is a connection establishment event; correspondingly, if the connection status determination unit determines that the Ethernet physical layer chip is in a connection establishment state, then the Ethernet network hardware accelerator is turned on based on the second control operation.
[0082] In some implementations, the preset process is an Ethernet power management process, and the file node operation module is further configured to monitor the operating system's sleep or wake-up operations through the Ethernet power management process.
[0083] In some implementations, the apparatus may further include a file node creation module configured to create the file node via the network hardware accelerator driver in response to operating system startup, wherein the file node remains present when the Ethernet card is turned off.
[0084] In some implementations, when the operating system sleeps or wakes up, a user-mode preset process and the kernel-mode network hardware accelerator driver interact based on the file node corresponding to the Ethernet network hardware accelerator. The user-mode preset process writes flag information indicating whether the operating system is sleeping or waking up, and whether the Ethernet network hardware accelerator needs to be turned on or off, into the file node. The kernel-mode network hardware accelerator driver then turns the Ethernet network hardware accelerator on or off based on the flag information. In this way, by actively manipulating the file node corresponding to the Ethernet network hardware accelerator through the user-mode process when the operating system sleeps or wakes up, the opening or closing of the Ethernet network hardware accelerator is achieved. This avoids frequent system sleeps and wake-ups, preventing the Ethernet network hardware accelerator application service process from failing to receive a wake-up event, which could lead to the Ethernet network hardware accelerator malfunction. This ensures the reliability of the Ethernet network hardware accelerator, thereby improving Ethernet communication speed, reducing CPU overhead, and enhancing user experience.
[0085] Referring to Figure 4, an embodiment of this disclosure provides an electronic device 20, including a processor 21 and a memory 22; wherein, the memory 22 is configured to store a computer program; and the processor 21 is configured to execute the computer program to implement the Ethernet network hardware accelerator control method of this disclosure.
[0086] The specific process of the Ethernet network hardware accelerator control method described above can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0087] In some implementations, the memory 22 serves as a carrier for resource storage and may be a read-only memory, random access memory, disk, or optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0088] In some embodiments, the electronic device 20 further includes a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26; wherein, the power supply 23 is configured to provide operating voltage to the various hardware devices on the electronic device 20; the communication interface 24 is capable of creating a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solutions of this disclosure, without specific limitations; the input / output interface 25 is configured to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, without specific limitations.
[0089] An embodiment of this disclosure also discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the Ethernet network hardware accelerator control method described in this disclosure.
[0090] The specific process of the Ethernet network hardware accelerator control method described above can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0091] 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.
[0092] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0093] The Ethernet network hardware accelerator control method, apparatus, device, and medium provided in this disclosure have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this disclosure. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this disclosure. 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 this disclosure. Therefore, the content of this specification should not be construed as a limitation of this disclosure.
Claims
1. A method for controlling an Ethernet network hardware accelerator, comprising: In response to the operating system's hibernation or wake-up operation, a preset process in user mode writes flag information to the file node corresponding to the Ethernet network hardware accelerator. The flag information includes a first preset value and a second preset value. The first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off. The second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on. as well as The Ethernet network hardware accelerator is turned on or off based on the flag information via the kernel-mode network hardware accelerator driver.
2. The Ethernet network hardware accelerator control method as described in claim 1, wherein the method of turning the Ethernet network hardware accelerator on or off based on the flag information via a kernel-mode network hardware accelerator driver includes: The first control task corresponding to the Ethernet network hardware accelerator is added to the work queue based on the flag information by the kernel-mode network hardware accelerator driver. as well as When the operating system schedules the work queue, it turns the Ethernet network hardware accelerator on or off based on the first control operation.
3. The Ethernet network hardware accelerator control method as described in claim 2, wherein turning the Ethernet network hardware accelerator on or off based on the first control operation includes: Based on the first control operation trigger callback function, the Ethernet network hardware accelerator is turned on or off through the callback function.
4. The Ethernet network hardware accelerator control method according to any one of claims 1 to 3, further comprising: Monitor state change events, wherein the state change event is an event triggered when the connection state of the Ethernet physical layer chip changes; Based on the state change event, add the second control task corresponding to the Ethernet network hardware accelerator to the work queue; and When the operating system schedules the work queue, it turns the Ethernet network hardware accelerator on or off based on the second control operation.
5. The Ethernet network hardware accelerator control method as described in claim 4, wherein when the state change event is a connection establishment event, before turning on the Ethernet network hardware accelerator based on the second control operation, it further includes: Determine whether the Ethernet physical layer chip is in a connection establishment state; If the Ethernet physical layer chip is in a connection establishment state, the Ethernet network hardware accelerator will be turned on based on the second control operation.
6. The Ethernet network hardware accelerator control method according to any one of claims 1 to 5, wherein the preset process is an Ethernet power management process, and the method further includes: The Ethernet power management process monitors the operating system's hibernation or wake-up operations.
7. The Ethernet network hardware accelerator control method according to any one of claims 1 to 6, further comprising: In response to the operating system booting up, the file node is created by the network hardware accelerator driver, wherein the file node persists even when the Ethernet card is turned off.
8. An Ethernet network hardware accelerator control device, comprising: The file node operation module is configured to respond to the operating system's hibernation or wake-up operation by writing flag information into the file node corresponding to the Ethernet network hardware accelerator through a user-mode preset process. The flag information includes a first preset value and a second preset value. The first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off. The second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on. as well as The accelerator control module is configured to turn the Ethernet network hardware accelerator on or off based on the flag information via a kernel-mode network hardware accelerator driver.
9. An electronic device comprising a memory and a processor, wherein: The memory is configured to store computer programs; The processor is configured to execute the computer program to implement the Ethernet network hardware accelerator control method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the Ethernet network hardware accelerator control method of any one of claims 1 to 7.