Ethernet network hardware accelerator control method, device, equipment and medium

By using user-state preset processes and kernel-state driver interactions when the operating system is sleeping or awakening, reliable control of the Ethernet network hardware accelerator is achieved, and the problem of frequent sleep wake-up is solved, which leads to functional failure and improves communication speed and user experience.

CN119512352APending Publication Date: 2025-02-25FIBOCOM AUTO SOFTWARE INC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411624141.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When the system is frequently sleeping and wake-up, the Ethernet network hardware accelerator is prone to functional failure, resulting in excessive device power consumption, slow communication and increased CPU overhead, affecting the user experience.

Method used

The preset process in the user state writes flag information to the file node of the Ethernet network hardware accelerator when the operating system is sleeping or awake, and is driven by the kernel state network hardware accelerator to turn on or off the Ethernet network hardware accelerator according to the flag information.

Benefits of technology

It ensures the reliability of the Ethernet network hardware accelerator, improves the Ethernet communication rate, reduces CPU overhead, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512352A_ABST
    Figure CN119512352A_ABST
Patent Text Reader

Abstract

The invention discloses an Ethernet network hardware accelerator control method and device, equipment and a medium, and the method comprises the steps: responding to an operation system dormancy or wake-up operation, writing mark information into a file node corresponding to an Ethernet network hardware accelerator through a preset process in a user mode, the mark information comprising a first preset value and a second preset value, the first preset value represents dormancy of the operating system, and the second preset value represents awakening of the operating system; and opening or closing the Ethernet network hardware accelerator based on the mark information through a network hardware accelerator drive in a kernel mode. Therefore, when the operating system is dormant or awakened, the preset process in the user mode and the network hardware accelerator in the kernel mode drive the file node based on the Ethernet network hardware accelerator to interact, so that the Ethernet network hardware accelerator is opened or closed, the reliability of the Ethernet network hardware accelerator can be guaranteed, and the reliability of the Ethernet network hardware accelerator is improved. Therefore, the communication rate of the Ethernet is improved, the overhead of a CPU (Central Processing Unit) is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to an Ethernet network hardware accelerator control method, device, equipment and medium. Background Art

[0002] IPA (IP accelerator, network hardware accelerator) is an independent hardware accelerator for the system on-chip network. Ethernet IPA is a submodule in IPA, which is specifically used to process network messages of Ethernet devices. In scenarios that are very sensitive to device power consumption, the Ethernet IPA channel needs to be closed when the system is dormant, and the Ethernet IPA channel needs to be opened after the system wakes up.

[0003] At present, when the system is working, Ethernet IPA is frequently turned on and off, which can easily cause the Ethernet IPA function to fail. When the system is in sleep mode, the Ethernet IPA function fails and the system cannot sleep, which causes the device to consume too much power. When waking up, the Ethernet IPA function fails, Ethernet communication is slow, and the CPU (Central Processing Unit) overhead is increased, affecting the user experience. Summary of the invention

[0004] In view of this, the purpose of this application is to provide an Ethernet network hardware accelerator control method, device, equipment and medium, which can ensure the reliability of the Ethernet network hardware accelerator, thereby increasing the communication rate of Ethernet, reducing CPU overhead, and improving user experience. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a method for controlling an Ethernet network hardware accelerator, comprising:

[0006] In response to the operating system hibernation or wake-up operation, write flag information into a file node corresponding to the Ethernet network hardware accelerator through a preset process in user mode, wherein the flag information includes a first preset value and a second preset value, wherein the first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off, and the second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on;

[0007] The Ethernet network hardware accelerator is turned on or off based on the flag information through a kernel-state network hardware accelerator driver.

[0008] Optionally, the step of turning on or off the Ethernet network hardware accelerator based on the flag information through a kernel-state network hardware accelerator driver includes:

[0009] By means of a kernel-state network hardware accelerator driver, adding a first control task corresponding to the Ethernet network hardware accelerator to a task queue based on the flag information;

[0010] When the operating system schedules the work queue, the Ethernet network hardware accelerator is turned on or off based on the first control task.

[0011] Optionally, turning on or off the Ethernet network hardware accelerator based on the first control operation includes:

[0012] A callback function is triggered based on the first control operation, and the Ethernet network hardware accelerator is turned on or off through the callback function.

[0013] Optionally, also include:

[0014] Monitoring state change events, wherein the state change events are events triggered when the connection state of the Ethernet physical layer chip changes;

[0015] Adding a second control task corresponding to the Ethernet network hardware accelerator to the task queue based on the state change event;

[0016] When the operating system schedules the work queue, the Ethernet network hardware accelerator is turned on or off based on the second control task.

[0017] Optionally, when the state change event is an event corresponding to connection establishment, before turning on the Ethernet network hardware accelerator based on the second control operation, the method further includes:

[0018] Determine whether the Ethernet physical layer chip is in a connection establishment state;

[0019] If the Ethernet physical layer chip is in a connection establishment state, the Ethernet network hardware accelerator is turned on based on the second control operation.

[0020] Optionally, the preset process is an Ethernet power management process, and the method further includes:

[0021] The operating system sleep or wake-up operation is monitored through the Ethernet power management process.

[0022] Optionally, also include:

[0023] In response to the operating system being turned on and running, the file node is created by the network hardware accelerator driver, wherein the file node remains in existence when the Ethernet card is turned off.

[0024] In a second aspect, the present application discloses an Ethernet network hardware accelerator control device, comprising:

[0025] In response to the operating system hibernation or wake-up operation, write flag information into a file node corresponding to the Ethernet network hardware accelerator through a preset process in user mode, wherein the flag information includes a first preset value and a second preset value, wherein the first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off, and the second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on;

[0026] The Ethernet network hardware accelerator is turned on or off based on the flag information through a kernel-state network hardware accelerator driver.

[0027] In a third aspect, the present application discloses an electronic device, including a memory and a processor, wherein:

[0028] The memory is used to store the computer program;

[0029] The processor is used to execute the computer program to implement the aforementioned Ethernet network hardware accelerator control method.

[0030] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned Ethernet network hardware accelerator control method when executed by a processor.

[0031] It can be seen from the above scheme that the present application provides an Ethernet network hardware accelerator control method, including: in response to an operating system sleep or wake-up operation, writing flag information into a file node corresponding to the Ethernet network hardware accelerator through a preset process in user state, the flag information including a first preset value and a second preset value, the first preset value indicating that the operating system is in sleep and the Ethernet network hardware accelerator needs to be turned off, and the second preset value indicating that the operating system is awake and the Ethernet network hardware accelerator needs to be turned on; through a kernel state network hardware accelerator driver, the Ethernet network hardware accelerator is turned on or off based on the flag information.

[0032] It can be seen that the beneficial effects of the present application are: when the operating system is dormant or awakened, the preset process in user state interacts with the network hardware accelerator driver in kernel state based on the file node corresponding to the Ethernet network hardware accelerator, and the preset process in user state writes the flag information representing the dormancy or awakening of the operating system and whether the Ethernet network hardware accelerator needs to be turned on or off into the file node, and the network hardware accelerator driver in kernel state turns the Ethernet network hardware accelerator on or off based on the flag information. In this way, the file node corresponding to the Ethernet network hardware accelerator is actively operated through the process in user state when the operating system is dormant or awakened, so as to realize the turning on or off of the Ethernet network hardware accelerator, thereby avoiding the frequent dormancy and awakening of the system, and the Ethernet network hardware accelerator function failure caused by the Ethernet network hardware accelerator application service process not receiving the wake-up event, which can ensure the reliability of the Ethernet network hardware accelerator, thereby improving the communication rate of Ethernet, reducing the CPU overhead, and improving the user experience.

[0033] Correspondingly, an Ethernet network hardware accelerator control device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0035] Figure 1 A flow chart of an Ethernet network hardware accelerator control method provided in an embodiment of the present application;

[0036] Figure 2 A specific Ethernet network hardware accelerator control flow chart provided in an embodiment of the present application;

[0037] Figure 3 A schematic diagram of the structure of an Ethernet network hardware accelerator control device provided in an embodiment of the present application;

[0038] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] 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.

[0040] IPA is an independent hardware accelerator for the system-on-chip network. It can directly implement the transfer of network data between Ethernet, Modem, and USB (Universal Serial Bus) without the direct involvement of the CPU, and realize direct access between memory spaces. Ethernet IPA is a submodule in IPA, which is specifically used to process network messages of Ethernet devices. When the network message of the peer device is transmitted to the module through the Ethernet PHY (Physical Layer) chip, the data link layer (TCP (Transmission Control Protocol) / IP (Internet Protocol) network model) receives the network message and can pass it to the Modem through the Ethernet IPA channel.

[0041] As a hardware module unit in the CPU, Ethernet IPA needs to close the Ethernet IPA channel when the system is in sleep mode, and open the Ethernet IPA channel after the system wakes up in scenarios that are very sensitive to device power consumption. During system operation, the system frequently goes into sleep and wakes up. If the IPA application service process does not receive a wake-up event, the Ethernet IPA function will fail. In this way, it is easy to cause the Ethernet IPA function to fail when the Ethernet IPA is frequently opened and closed. When the system is in sleep mode, the Ethernet IPA function fails and the system cannot go into sleep mode, which causes excessive power consumption of the device. When waking up, the Ethernet IPA function fails, Ethernet communication is slow, CPU overhead is increased, and user experience is affected. To this end, the present application provides an Ethernet network hardware accelerator control scheme that can ensure the reliability of the Ethernet network hardware accelerator, thereby improving the communication rate of the Ethernet, reducing the CPU overhead, and improving the user experience.

[0042] See also Figure 1 As shown, the embodiment of the present application discloses a method for controlling an Ethernet network hardware accelerator, comprising:

[0043] Step S11: In response to the operating system sleep or wake-up operation, write flag information into the file node corresponding to the Ethernet network hardware accelerator through a preset process in user mode, wherein the flag information includes a first preset value and a second preset value, wherein the first preset value indicates that the operating system is in sleep mode and the Ethernet network hardware accelerator needs to be turned off, and the second preset value indicates that the operating system is awakened and the Ethernet network hardware accelerator needs to be turned on.

[0044] Among them, operating system hibernation is to save the program currently running in the operating system in the hard disk and then cut off all power supplies. Operating system wakeup is the process of reactivating an operating system in a dormant or sleeping state and restoring it to a normal working state. The operating system hibernation operation can be understood as an operation to control the operating system to enter a dormant state, and the operating system wakeup operation can be understood as an operation to wake up the operating system. User state and kernel state represent different permission levels in the computer operating system. User state is the state when the application is running. In user state, the program can only access restricted computer resources and cannot execute privileged instructions. The preset process in user state can be understood as a user state process that can monitor the operating system hibernation or wakeup operation. The embodiment of the present application can monitor the various steps and state changes in the operating system hibernation and wakeup process through a preset process to determine whether the operating system is about to enter hibernation or be awakened.

[0045] In an optional embodiment, the preset process is an Ethernet power management process, and the Ethernet power management process can be used to monitor the sleep or wake-up operation of the operating system. The Ethernet power management process can be understood as a process specifically used by Ethernet to manage power. Sleep and wake-up are two important parts of the computer power management function. The Ethernet power management process can effectively manage the power status of the system and improve the energy efficiency and user experience of the system.

[0046] In an optional embodiment, in response to the operating system starting up, the file node is created by the network hardware accelerator driver, wherein the file node remains when the Ethernet card is turned off. The network hardware accelerator driver can be understood as a driver corresponding to the Ethernet network hardware accelerator.

[0047] It should be pointed out that the file node of the Ethernet network hardware accelerator will be deleted when the network card is turned off (eth0). When the network card is turned on, the creation of the file node of the Ethernet network hardware accelerator depends on the link up (i.e., connection establishment) state of the PHY (i.e., Ethernet physical layer chip). If the PHY is not linked up, the file node creation fails, resulting in the failure of the application process operation IPA file section. This embodiment can turn off the operation of deleting the file node of the Ethernet network hardware accelerator when the gateway is turned off, so that the file node remains when the Ethernet card is turned off, avoiding the deletion of the file node of the Ethernet network hardware accelerator when the network card is turned off, resulting in the failure of the operation IPA file section.

[0048] In this embodiment, the flag information can be understood as information that can represent the sleep or wake-up state of the operating system. 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.

[0049] Step S12: The Ethernet network hardware accelerator is turned on or off based on the flag information through the kernel-state network hardware accelerator driver.

[0050] Among them, kernel state is the privileged state of the operating system, in which the kernel code of the operating system runs. Kernel state is the core part of the operating system to realize its functions and provide services, manage the hardware and software resources of the system, and ensure the security and stability of the system.

[0051] In an optional implementation, the network hardware accelerator driver in kernel state can add the first control task corresponding to the Ethernet network hardware accelerator to the work queue based on the flag information; when the operating system schedules the work queue, the Ethernet network hardware accelerator is turned on or off based on the first control task.

[0052] The work queue may be initialized by a network hardware accelerator driver. In this embodiment, in response to the operating system starting up, the network hardware accelerator driver may be loaded, and the file node may be created and the work queue may be initialized through the network hardware accelerator driver.

[0053] In an optional implementation, a callback function may be triggered based on the first control work, and the Ethernet network hardware accelerator may be turned on or off through the callback function. In this embodiment, a corresponding work thread may be created based on the first control work, and a callback function may be triggered by the work thread, and the Ethernet network hardware accelerator may be turned on or off through the callback function.

[0054] Furthermore, in an optional implementation, the present application may 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.

[0055] Among them, 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, that is, the connection state of the physical layer, can include a connection establishment state and a connection port state. Correspondingly, the state change event can include a connection establishment event and a connection disconnection event. The state change event can be monitored by the network hardware accelerator driver, and the second control work corresponding to the Ethernet network hardware accelerator is added to the work queue based on the state change event.

[0056] The present application triggers a state change event when the connection state of the Ethernet physical layer chip changes, adds the second control work corresponding to the corresponding Ethernet network hardware accelerator to the work queue, and turns on or off the Ethernet network hardware accelerator. In this way, the Ethernet network hardware accelerator is turned on or off according to the connection state of the Ethernet physical layer chip, which can make the turning on or off of the Ethernet network hardware accelerator more in line with actual needs, further ensure the reliability of the Ethernet network hardware accelerator, thereby improving the communication rate of the Ethernet, reducing the CPU overhead, and improving the user experience.

[0057] In an optional implementation, when the state change event is an event corresponding to connection establishment, before turning on the Ethernet network hardware accelerator based on the second control work, 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, the Ethernet network hardware accelerator is turned on based on the second control work.

[0058] In the embodiment of the present application, when the state change event is an event corresponding to connection establishment, before turning on the Ethernet network hardware accelerator, the connection state of the Ethernet physical layer chip is judged, and the Ethernet network hardware accelerator is turned on when the Ethernet physical layer chip is in the connection establishment state. This can ensure that the Ethernet network hardware accelerator is turned on when the Ethernet physical layer chip is connected and avoid turning on the Ethernet network hardware accelerator when the Ethernet physical layer chip is disconnected, which leads to increased power consumption.

[0059] It can be seen that in the embodiment of the present application, when the operating system is dormant or awakened, the preset process in user state interacts with the network hardware accelerator driver in kernel state based on the file node corresponding to the Ethernet network hardware accelerator. The preset process in user state writes the flag information representing whether the operating system is dormant or awakened, and whether the Ethernet network hardware accelerator needs to be turned on or off into the file node, and the network hardware accelerator driver in kernel state turns the Ethernet network hardware accelerator on or off based on the flag information. In this way, the file node corresponding to the Ethernet network hardware accelerator is actively operated through the process in user state when the operating system is dormant or awakened, so as to realize the turning on or off of the Ethernet network hardware accelerator, thereby avoiding the frequent dormancy and awakening of the system, and the Ethernet network hardware accelerator function failure caused by the Ethernet network hardware accelerator application service process not receiving the wake-up event, which can ensure the reliability of the Ethernet network hardware accelerator, thereby improving the communication rate of Ethernet, reducing the CPU overhead, and improving the user experience.

[0060] For further information, see Figure 2 As shown, Figure 2 A specific Ethernet network hardware accelerator control flow chart provided in an embodiment of the present application.

[0061] When the system is started and the IPA driver is loaded, a file node corresponding to the Ethernet IPA is created and recorded as the IPA file node and a workqueue is initialized. After the IPA file node is initialized and created, it will always exist and will not be deleted even if the network card (eth0) is turned off. Workqueue is a general mechanism for kernel threads to asynchronously execute work tasks.

[0062] When the link status of PHY changes, a netdev_change event (i.e., a status change event) is triggered, and the IPA driver adds the work (i.e., control work) of Ethernet IPA to the workqueue. When the system schedules the workqueue, the work callback function is triggered, and then the Ethernet IPA is turned on or off according to the link status of PHY. It can be determined whether it is a LINK UP event. If it is a LINK UP event, the Ethernet IPA is turned on based on the work thread. Before turning on the Ethernet IPA based on the work thread, it is determined whether the PHY status is LINK UP, and if so, the Ethernet IPA is turned on. If it is not a LINK UP event, the Ethernet IPA is turned off based on the work thread.

[0063] When the system is in hibernation, the Ethernet power management process (i.e., the power_mgr process) will operate the IPA file node to close the Ethernet IPA channel. When the system wakes up, the Ethernet power management process will operate the IPA file node to open the Ethernet IPA channel. Specifically, if the system needs to enter hibernation, the power_mgr process writes 1 to the IPA file node, and the IPA driver adds the work of the Ethernet IPA 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 is awakened, the power_mgr process writes 0 to the IPA file node, and the IPA driver adds the work of the Ethernet IPA 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 is determined whether the PHY status is LINK UP. If so, the Ethernet IPA is opened.

[0064] That is, in the embodiment of the present application, when the system is powered on and the IPA driver is loaded, an IPA file node is created and a workqueue is initialized. When the link status of the PHY is changed, a netdew_change event is triggered to turn the IPA on or off. When the system is dormant, the Ethernet power management process will actively turn off the IPA, and will actively turn on the IPA after the system wakes up.

[0065] In this way, the Ethernet IPA file node will still exist after the network card (eth0) is turned off, and the application process will not fail to read and write the IPA file node. The system frequently goes to sleep and wake up, and there will be no problem that the Ethernet IPA function cannot take effect, and the system cannot go to sleep and the power consumption is too high. The CPU overhead is reduced and the user experience is improved. Appropriate improvements are made to the original Ethernet IPA framework to make the Ethernet IPA very stable and reliable in frequent opening and closing scenarios.

[0066] The present application provides an Ethernet IPA management and control solution to solve the problem of Ethernet IPA function failure caused by frequent sleep and wake-up, thereby increasing the communication rate of Ethernet, reducing CPU overhead, and improving user experience. For example, in a certain 5G (5th Generation Mobile Communication Technology) communication module CPE (Customer Premise Equipment) product, after using the solution provided by this application, the communication rate of Ethernet has been greatly improved and the system CPU overhead has been reduced. There is a great improvement in functional integrity and performance, bringing a good user experience.

[0067] See also Figure 3 As shown, an Ethernet network hardware accelerator control device according to an embodiment of the present application includes:

[0068] The file node operation module 11 is used to respond to the operating system sleep or wake-up operation, and write the flag information into the file node corresponding to the Ethernet network hardware accelerator through the preset process in the user state, wherein the flag information includes a first preset value and a second preset value, wherein the first preset value indicates that the operating system is in sleep mode and the Ethernet network hardware accelerator needs to be turned off, and the second preset value indicates that the operating system is awakened and the Ethernet network hardware accelerator needs to be turned on.

[0069] The accelerator control module 12 is used to turn on or off the Ethernet network hardware accelerator based on the flag information through the network hardware accelerator driver in the kernel state.

[0070] The accelerator control module 12 may specifically include:

[0071] A queue adding submodule, used for adding the first control task corresponding to the Ethernet network hardware accelerator to the task queue based on the flag information through the kernel-state network hardware accelerator driver;

[0072] The accelerator control submodule is used to turn on or off the Ethernet network hardware accelerator based on the first control task when the operating system schedules the task queue.

[0073] In an optional implementation, the accelerator control submodule is specifically configured to trigger a callback function based on the first control operation, and turn on or off the Ethernet network hardware accelerator through the callback function.

[0074] In an optional embodiment, the device may further include:

[0075] A state change event monitoring module, used 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;

[0076] Correspondingly, the queue adding submodule is further used 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 further used to turn on or off the Ethernet network hardware accelerator based on the second control task when the operating system schedules the work queue.

[0077] Furthermore, the accelerator control submodule also includes a connection status judgment unit, which is used to judge 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 work when the state change event is an event corresponding to connection establishment; accordingly, if the connection status judgment unit determines that the Ethernet physical layer chip is in a connection establishment state, the Ethernet network hardware accelerator is turned on based on the second control work.

[0078] In an optional implementation, the preset process is an Ethernet power management process, and the file node operation module is further used to monitor the operating system sleep or wake-up operation through the Ethernet power management process.

[0079] Furthermore, the device may also include a file node creation module, which is used to create the file node through the network hardware accelerator driver in response to the operating system being turned on, wherein the file node remains in existence when the Ethernet card is turned off.

[0080] It can be seen that in the embodiment of the present application, when the operating system is dormant or awakened, the preset process in user state interacts with the network hardware accelerator driver in kernel state based on the file node corresponding to the Ethernet network hardware accelerator. The preset process in user state writes the flag information representing whether the operating system is dormant or awakened, and whether the Ethernet network hardware accelerator needs to be turned on or off into the file node, and the network hardware accelerator driver in kernel state turns the Ethernet network hardware accelerator on or off based on the flag information. In this way, the file node corresponding to the Ethernet network hardware accelerator is actively operated through the process in user state when the operating system is dormant or awakened, so as to realize the turning on or off of the Ethernet network hardware accelerator, thereby avoiding the frequent dormancy and awakening of the system, and the Ethernet network hardware accelerator function failure caused by the Ethernet network hardware accelerator application service process not receiving the wake-up event, which can ensure the reliability of the Ethernet network hardware accelerator, thereby improving the communication rate of Ethernet, reducing the CPU overhead, and improving the user experience.

[0081] See also Figure 4 As shown, an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store a computer program; the processor 21 is used to execute the computer program, the Ethernet network hardware accelerator control method disclosed in the above embodiment.

[0082] For the specific process of the above-mentioned Ethernet network hardware accelerator control method, reference may be made to the corresponding contents disclosed in the above-mentioned embodiments, which will not be described in detail here.

[0083] Furthermore, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0084] In addition, the electronic device 20 also 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 used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0085] Furthermore, an embodiment of the present application 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 disclosed in the aforementioned embodiment.

[0086] For the specific process of the above-mentioned Ethernet network hardware accelerator control method, reference may be made to the corresponding contents disclosed in the above-mentioned embodiments, which will not be described in detail here.

[0087] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0088] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0089] The above is a detailed introduction to an Ethernet network hardware accelerator control method, device, equipment and 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 of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for controlling an Ethernet network hardware accelerator, characterized in that: include: In response to the operating system hibernation or wake-up operation, write flag information into a file node corresponding to the Ethernet network hardware accelerator through a preset process in user mode, wherein the flag information includes a first preset value and a second preset value, wherein the first preset value indicates that the operating system is hibernating and the Ethernet network hardware accelerator needs to be turned off, and the second preset value indicates that the operating system is waking up and the Ethernet network hardware accelerator needs to be turned on; The Ethernet network hardware accelerator is turned on or off based on the flag information through a kernel-state network hardware accelerator driver.

2. The Ethernet network hardware accelerator control method according to claim 1, characterized in that: The method of turning on or off the Ethernet network hardware accelerator based on the flag information through the kernel-state network hardware accelerator driver includes: By means of a kernel-state network hardware accelerator driver, adding a first control task corresponding to the Ethernet network hardware accelerator to a task queue based on the flag information; When the operating system schedules the work queue, the Ethernet network hardware accelerator is turned on or off based on the first control task.

3. The Ethernet network hardware accelerator control method according to claim 2, characterized in that: The step of turning on or off the Ethernet network hardware accelerator based on the first control operation includes: A callback function is triggered based on the first control operation, and the Ethernet network hardware accelerator is turned on or off through the callback function.

4. The Ethernet network hardware accelerator control method according to claim 1, characterized in that: Also includes: Monitoring state change events, wherein the state change events are events triggered when the connection state of the Ethernet physical layer chip changes; Adding a second control task corresponding to the Ethernet network hardware accelerator to the task queue based on the state change event; When the operating system schedules the work queue, the Ethernet network hardware accelerator is turned on or off based on the second control task.

5. The Ethernet network hardware accelerator control method according to claim 4, characterized in that: When the state change event is an event corresponding to connection establishment, before turning on the Ethernet network hardware accelerator based on the second control operation, the method 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 is turned on based on the second control operation.

6. The Ethernet network hardware accelerator control method according to claim 1, characterized in that: The preset process is an Ethernet power management process, and the method further includes: The operating system sleep or wake-up operation is monitored through the Ethernet power management process.

7. The Ethernet network hardware accelerator control method according to any one of claims 1 to 6, characterized in that: Also includes: In response to the operating system being turned on and running, the file node is created by the network hardware accelerator driver, wherein the file node remains in existence when the Ethernet card is turned off.

8. An Ethernet network hardware accelerator control device, characterized in that: include: A file node operation module, configured to respond to an operating system sleep or wake-up operation, and write flag information to a file node corresponding to the Ethernet network hardware accelerator through a preset process in a user state, wherein the flag information includes a first preset value and a second preset value, wherein the first preset value indicates that the operating system is in sleep mode and the Ethernet network hardware accelerator needs to be turned off, and the second preset value indicates that the operating system is awake and the Ethernet network hardware accelerator needs to be turned on; The accelerator control module is used to turn on or off the Ethernet network hardware accelerator based on the flag information through the network hardware accelerator driver in the kernel state.

9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used 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, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the Ethernet network hardware accelerator control method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Method and apparatus for controlling ethernet IP accelerator, and device and medium

    WO2026103035A1