Network chip management method and apparatus, communication device, and storage medium
The technology of this application relates to a network chip management method. In the method, resource requirement information of a current network for a network chip is determined based on one or more of port information, configuration information, and traffic information of the network chip. A target operating frequency of the network chip is determined based on the resource requirement information. The network chip is controlled to operate at the target operating frequency. In this way, an operating frequency of the network chip adapts to the current network, so that power consumption of the network chip can be dynamically adjusted based on the current network, and the power consumption of the network chip is reduced while a network requirement is met.
1 . A method applied to a communication device, the communication device including, at least, a service board having a network chip, and the method comprising:
determining resource requirement information, of a current network for a plurality of functional modules of the network chip, based on one or more of: port information, configuration information, and traffic information of the network chip, wherein a plurality of first functional modules is a subset of the plurality of functional modules for which the current network has a resource requirement;
determining, based on the resource requirement information of the current network for each first functional module of the network chip, a plurality of target operating frequencies of the network chip, wherein each target operating frequency corresponds to a respective subset of first functional modules; and
controlling each subset of first functional modules of the network chip to operate at a corresponding target operating frequency.
2 . The method according to claim 1 , wherein
the port information includes a status of each port of the network chip,
the configuration information includes at least one of a protocol configured for the network chip, and an entry configuration capacity of the network chip, and
the traffic information includes at least one of a replication bandwidth requirement of the network chip in a first target duration, a maximum millisecond-level burst of the network chip in a second target duration, and a maximum buffer waterline of the network chip in a third target duration.
3 . The method according to claim 2 , wherein
the resource requirement information, of the current network for the network chip, is included for each functional module of the network chip, and
determining the resource requirement information for the network chip comprises:
determining resource requirement information of the current network for an interface module of the network chip based on the status of a port of the network chip;
determining resource requirement information of the current network for a data channel processing module of the network chip based on the replication bandwidth requirement of the network chip in the first target duration and the protocol configured for the network chip;
determining resource requirement information of the current network for a forwarding processing core of the network chip based on the maximum millisecond-level burst of the network chip in the second target duration;
determining resource requirement information of the current network for a traffic scheduling module of the network chip based on the maximum buffer waterline of the network chip in the third target duration; or
determining resource requirement information of the current network for a table lookup module of the network chip based on the entry configuration capacity of the network chip.
4 . The method according to claim 1 , wherein
the resource requirement information of the current network for the network chip is included for a functional module, of the plurality of functional modules, of the network chip, and
determining the target operating frequency of the network chip based on the resource requirement information for the network chip comprises:
determining, based on resource requirement information of the current network for each of the first functional modules of the network chip, a target operating frequency corresponding to each of the first functional modules, wherein the current network has a resource requirement for each of the first functional modules; and
controlling each of the first functional modules to operate at the corresponding target operating frequency.
5 . The method according to claim 4 , wherein
a second functional module is one of the plurality of functional modules for which the current network has no resource requirement, and
after determining resource requirement information of the current network for the network chip, the method further comprises:
controlling the second functional module of the network chip to switch from an operating state to a dormant state.
6 . The method according to claim 5 , wherein controlling the second functional module of the network chip to switch from the operating state to the dormant state comprises:
controlling the second functional module to remain in a reset state;
controlling to perform clock gating on the second functional module;
controlling to perform power gating on the second functional module; or
controlling the second functional module to operate at a dormant operating frequency, wherein the dormant operating frequency is lower than 5% of a standard operating frequency of the second functional module.
7 . The method according to claim 5 , wherein after controlling the second functional module of the network chip to switch from the operating state to the dormant state, the method further comprises:
in association with the current network including a resource requirement for the second functional module of the network chip, controlling the second functional module to switch from the dormant state to the operating state.
8 . The method according to claim 5 , wherein after controlling the second functional module of the network chip to switch from the operating state to the dormant state, the method further comprises:
controlling the second functional module to switch from the dormant state to the operating state in association with a failure mode and effect analysis (FMEA) detection periodicity being reached; and
controlling the network chip to perform FMEA detection.
9 . The method according to claim 8 , further comprising:
adjusting a voltage of the network chip to a target voltage matching the target operating frequency.
10 . The method according to claim 1 , wherein after controlling the network chip to operate at the target operating frequency, the method further comprises:
obtaining power consumption of the network chip at the target operating frequency; and
adjusting a phase quantity of a voltage regulator module (VRM) of the network chip based on the power consumption of the network chip at the target operating frequency.
11 . The method according to claim 10 , wherein obtaining the power consumption of the network chip at the target operating frequency comprises:
obtaining reference power consumption of the network chip at a standard operating frequency, wherein
the power consumption of the network chip at the target operating frequency is determined based on the reference power consumption, the standard operating frequency, and the target operating frequency.
12 . The method according to claim 10 , wherein obtaining the power consumption of the network chip at the target operating frequency comprises:
detecting the power consumption of the network chip at the target operating frequency.
13 . An apparatus associated with a communication device, the communication device including a service board having a network chip, and the apparatus comprising:
a processor; and
a memory configured to store computer readable instructions that, when executed by the processor, cause the apparatus to:
determine resource requirement information, of a current network for a plurality of functional modules of the network chip, based on one or more of: port information, configuration information, and traffic information of the network chip, wherein a plurality of first functional modules is a subset of the plurality of functional modules for which the current network has a resource requirement;
determine, based on the resource requirement information of the current network for each first functional module of the network chip, a plurality of target operating frequencies of the network chip, wherein each target operating frequency corresponds to a respective subset of first functional modules; and
control each subset of first functional modules of the network chip to operate at a corresponding target operating frequency.
14 . The apparatus according to claim 13 , wherein
the port information includes a status of each port of the network chip,
the configuration information includes at least one of a protocol configured for the network chip, and an entry configuration capacity of the network chip,
the traffic information includes at least one of a replication bandwidth requirement of the network chip in a first target duration, a maximum millisecond-level burst of the network chip in a second target duration, and a maximum buffer waterline of the network chip in a third target duration,
the resource requirement information of the current network for the network chip is included for each functional module of the network chip,
the resource requirement information for the network chip is determined for any of an interface module, a data channel processing module, a forwarding processing core, a traffic scheduling module, or a table lookup module of the network chip, and
the resource requirement information of the current network for the interface module of the network chip is determined based on the status of the port of the network chip,
the resource requirement information of the current network for the data channel processing module of the network chip is determined based on the replication bandwidth requirement of the network chip in the first target duration and the protocol configured for the network chip,
the resource requirement information of the current network for the forwarding processing core of the network chip is determined based on the maximum millisecond-level burst of the network chip in the second target duration,
the resource requirement information of the current network for the traffic scheduling module of the network chip is determined based on the maximum buffer waterline of the network chip in the third target duration, and
the resource requirement information of the current network for the table lookup module of the network chip is determined based on the entry configuration capacity of the network chip.
15 . The apparatus according to claim 13 , wherein
the resource requirement information of the current network for the network chip is included for a functional module, of the plurality of functional modules, of the network chip, and
the apparatus is further caused to:
determine, based on resource requirement information of the current network for each of the first functional modules of the network chip, a target operating frequency corresponding to each of the first functional modules, wherein the current network has a resource requirement for each of the first functional modules; and
control each of the first functional modules to operate at the corresponding target operating frequency.
16 . The apparatus according to claim 15 , wherein
a second functional module is one of the plurality of functional modules for which the current network has no resource requirement, and
the apparatus is further caused to:
control the second functional module of the network chip to switch from an operating state to a dormant state.
17 . The apparatus according to claim 16 , wherein the apparatus is further caused to:
control the second functional module to remain in a reset state;
control to perform clock gating on the second functional module;
control to perform power gating on the second functional module; or
control the second functional module to operate at a dormant operating frequency, wherein the dormant operating frequency is lower than 5% of a standard operating frequency of the second functional module.
18 . The apparatus according to claim 16 , wherein the apparatus further comprises a first wake-up module, and after the second functional module switches from the operating state to the dormant state, the first wake-up module is configured to:
when the current network includes a resource requirement for the second functional module of the network chip, control the second functional module to switch from the dormant state to the operating state.
19 . The apparatus according to claim 16 , wherein the apparatus is further caused to:
control the second functional module to switch from the dormant state to the operating state when a failure mode and effect analysis (FMEA) detection periodicity is reached; and
control the network chip to perform FMEA detection.
20 . A non-transitory computer readable storage medium configured to store computer readable instructions that, when executed by a processor of a device having a service board that includes a network chip, cause the device to provide execution comprising:
determining resource requirement information, of a current network for a plurality of functional modules of the network chip, based on one or more of: port information, configuration information, and traffic information of the network chip, wherein a plurality of first functional modules is a subset of the plurality of functional modules for which the current network has a resource requirement;
determining, based on the resource requirement information of the current network for each first functional module of the network chip, a plurality of target operating frequencies of the network chip, wherein each target operating frequency corresponds to a respective subset of first functional modules; and
controlling each subset of first functional modules of the network chip to operate at a corresponding target operating frequency.