Dynamically assigning packet flows
In general, in one aspect, the disclosure describes a method includes accessing data of an egress packet belonging to a flow, storing data associating the flow with at least one queue based on a source of the data of the egress packet. The method also includes accessing an ingress packet belonging to the flow, performing a lookup of the at least one queue associated with the flow, and enqueueing data of the ingress packet to the at least one queue associated with the flow.
1. A network interface controller, comprising:
an interface to a media access controller to receive ingress packets from a network connection;
at least one interface to multiple processors commonly served by the network interface controller; and
circuitry to:
receive ingress packets from the media access controller and process respective ingress packets by:
determining a first identifier for a respective ingress packet based at least in part on data fields within a header of the respective ingress packet;
performing a lookup of a table based on the first identifier, the table associating identifiers with respective ones of the multiple processors commonly served by the network interface controller; and
enqueuing the respective ingress packet for receipt by a one of the multiple processors associated with the identifier by the table; and
receive egress packets from the multiple processors commonly served by the network interface controller and process respective egress packets by:
determining a second identifier based at least in part on data fields within a header of a respective egress packet received from a one of the multiple processors; and
modifying the table to associate the second identifier with the one of the multiple processors from which the egress packet was received, wherein subsequently received ingress packets belonging to a same flow as the egress packet are enqueued for receipt by the one of the multiple processors from which the egress packet was received;
wherein each of the multiple processors is associated with a different receive queue and transmit queue pair;
wherein the table associating respective identifiers with respective ones of the multiple processors commonly served by the network interface controller comprises a table associating respective identifiers with respective receive queue and transmit queue pairs associated with the respective multiple processors;
wherein enqueueing the respective ingress packet for receipt by a one of the multiple processors comprises enqueuing the respective ingress packet to a receive queue of the receive queue and transmit queue pair associated with the one of the multiple processors; and
wherein egress packets from the multiple processors are in enqueued in a transmit queue of the receive queue and transmit queue pair associated with the one of the multiple processor.
2. The network interface controller of claim 1 , wherein the network interface controller further comprises the media access controller.
3. The network interface controller of claim 1 , wherein the first identifier comprises a hash of at least the following data fields: the Internet Protocol source and destination addresses and the Transmission Control Protocol source and destination ports.
4. The network interface controller of claim 1 , wherein the processors comprise processors integrated on the same die.
5. A method, comprising:
receiving, at a network interface controller commonly serving a set of multiple processors, ingress packets and processing respective ingress packets by:
determining a first identifier for a respective ingress packet based at least in part on data fields within a header of the respective ingress packet;
performing a lookup of a table based on the first identifier, the table associating identifiers with respective ones of the set of multiple processors; and
enqueuing the respective ingress packet for receipt by a one of the multiple processors associated with the identifier by the table; and
receiving, at the network interface controller, egress packets from the multiple processors commonly served by the network interface controller and processing respective egress packets by:
determining a second identifier based at least in part on data fields within a header of a respective egress packet received from a one of the multiple processors; and
modifying the table to associate the second identifier with the one of the multiple processors from which the egress packet was received, wherein subsequently received ingress packets belonging to a same flow as the egress packet are enqueued for receipt by the one of the multiple processors from which the egress packet was received;
wherein each of the multiple processors is associated with a different receive queue and transmit queue pair;
wherein the table associating respective identifiers with respective ones of the multiple processors commonly served by the network interface controller comprises a table associating respective identifiers with respective receive queue and transmit queue pairs associated with the respective multiple processors;
wherein enqueueing the respective ingress packet for receipt by a one of the multiple processors comprises enqueuing the respective ingress packet to a receive queue of the receive queue and transmit queue pair associated with the one of the multiple processors; and
wherein egress packets from the multiple processors are in enqueued in a transmit queue of the receive queue and transmit queue pair associated with the one of the multiple processors.
6. The method of claim 5 , wherein the first identifier comprises a hash of at least the following data fields: the Internet Protocol source and destination addresses and the Transmission Control Protocol source and destination ports.
7. The method of claim 5 , wherein the processors comprise processors integrated on the same die.
8. The method of claim 5 ,
wherein respective ones of the multiple processors load a TCP (Transmission Control Protocol) TCB (Transmission Control Block) for packet flows mapped to the respective processors by the network interface controller.