Adaptive threads assignment for receiving packets
AssigneeIntel Corporation
InventorRichard Zhang
Life of this patent
Estimating the term…
Abstract
Systems and methods for assigning threads in a processor are disclosed. The method generally includes assigning one or more static threads to each port of a plurality of ports and processing incoming packets with the static threads. The port numbers of incoming packets processed by the static threads are stored and the number of packets processed by the static threads for each port is counted. An average thread workload for each port is calculated by dividing the number of packets processed by the number of static threads assigned to the port. A dynamic thread is assigned to the highest average thread workload port.
Claims20
A method for assigning threads in a processor, comprising:
- assigning one or more static threads to each port of a plurality of ports;
- processing incoming packets with the static threads;
- storing the port numbers of incoming packets processed by the static threads;
- counting the number of packets processed by the static threads for each port;
- calculating an average thread workload for each port;
- determining a highest average thread workload port by comparing the average thread workload for each port;
- and
- assigning a dynamic thread to the highest average thread workload port to process incoming packets.
A method for assigning threads in a processor, comprising:
- assigning one or more static threads to each port of a plurality of ports to process incoming packets;
- providing a data structure containing the port numbers of incoming packets processed by static threads;
- providing a plurality of counters, each counter being associated with a port number and counts a frequency of appearance of the port number in the data structure;
- processing a new incoming packet with a static thread;
- updating the data structure by discarding the port number associated with an oldest packet processed and inserting the port number of the new incoming packet;
- updating the plurality of counters by decrementing by one the counter associated with the port number of the oldest packet processed and incrementing by one the counter associated with the port number of the new incoming packet;
- calculating an average thread workload for each port based on the value of each counter;
- determining a highest average thread workload port by comparing the average thread workload for each port;
- and
- assigning a dynamic thread to the highest average thread workload port.
A computer readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for assigning threads in a processor, comprising:
- assigning one or more static threads to each port of a plurality of ports;
- processing incoming packets with the static threads;
- storing the port numbers of incoming packets processed by the static threads;
- counting the number of packets processed by the static threads for each port;
- calculating an average thread workload for each port;
- determining a highest average thread workload port by comparing the average thread workload for each port;
- and
- assigning a dynamic thread to the highest average thread workload port to process incoming packets.
A computer readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for assigning threads in a processor, comprising:
- assigning one or more static threads to each port of a plurality of ports to process incoming packets;
- providing a data structure containing the port numbers of incoming packets processed by static threads;
- providing a plurality of counters, each counter being associated with a port number and counts a frequency of appearance of the port number in the data structure;
- processing a new incoming packet with a static thread;
- updating the data structure by discarding the port number associated with an oldest packet processed and inserting the port number of the new incoming packet;
- updating the plurality of counters by decrementing by one the counter associated with the port number of the oldest packet processed and incrementing by one the counter associated with the port number of the new incoming packet;
- calculating an average thread workload for each port based on the value of each counter;
- determining a highest average thread workload port by comparing the average thread workload for each port;
- and
- assigning a dynamic thread to the highest average thread workload port.
An apparatus for assigning threads in a processor, comprising:
- a static thread assigning mechanism for assigning one or more static threads to each port of a plurality of ports;
- a processing mechanism for processing incoming packets with the static threads;
- a storage mechanism for storing the port numbers of incoming packets processed by the static threads;
- a counting mechanism for counting the number of packets processed by the static threads for each port;
- an analysis mechanism for calculating an average thread workload for each port and determining a highest average thread workload port;
- and
- a dynamic thread assigning mechanism for assigning a dynamic thread to the highest average thread workload port.
Dependencies are inferred from the claim text.