Network device that utilizes packet grouping
A packet group processor of a network device defines groups of packets among packets that are being processed by the network device, each of at least some of the groups of packets defining a respective group of at least two different packets. Each group includes one or more packets to be transmitted via a respective same network interface. A transmit processor makes a single transmit decision that a particular group of at least two packets is to be transmitted via a corresponding network interface, and in response to the single transmit decision, transfers the particular group of at least two packets to the corresponding network interface for transmission.
1 . A network device, comprising:
a plurality of network interfaces configured to couple to a plurality of network links;
a packet buffer;
a receive processor configured to store in the packet buffer packets that are received by the network device via the plurality of network interfaces;
a plurality of first-in-first-out (FIFO) queues;
a packet processor configured to i) process packets received via the plurality of network interfaces to make forwarding decisions regarding the packets, ii) generate, for each of at least some of the packets received via the plurality of network interfaces, a packet descriptor that includes metadata regarding the packet, and iii) store the packet descriptors in FIFO queues corresponding to network interfaces via which the packets are to be transmitted;
a packet grouping processor configured to define groups of packets among packets that are being processed by the network device, each of at least some of the groups of packets defining a respective group of at least two different packets, each group including one or more packets to be transmitted via a respective same network interface, the packet grouping processor further configured to, for each group of at least two packets, i) define the group using packet descriptors a) corresponding to the at least two packets and b) stored in a FIFO queue corresponding to a network interface via which the at least two packets are to be transmitted, ii) generate a respective group descriptor for the group, and iii) store the group descriptor in the FIFO queue corresponding to the network interfaces via which the at least two packets are to be transmitted; and
a transmit processor configured to:
make a single transmit decision that a particular group of at least two packets is to be transmitted via a corresponding network interface at least by dequeuing a group descriptor corresponding to the particular group from a FIFO queue corresponding to the network interface, and
in response to dequeuing the group descriptor corresponding to the particular group from the FIFO queue corresponding to the network interface, transfer the particular group of at least two packets to the corresponding network interface for transmission.
2 . The network device of claim 1 , wherein:
the packet grouping processor is further configured to generate, for each group of at least two packets, the respective group descriptor to include metadata regarding the respective group of packets, the metadata including information that specifies at least which packets are included in the respective group of packets.
3 . The network device of claim 2 , wherein:
the packet grouping processor is further configured to schedule groups of multiple packets for transmission from the network device via the particular network interface, including storing group descriptors corresponding to the groups of multiple packets for transmission via the particular network interface in a particular FIFO queue corresponding to the particular network interface.
4 . The network device of claim 2 , wherein the packet grouping processor is further configured to:
generate each group descriptor to include respective packet descriptors corresponding to packets that are members of the respective group of at least two packets.
5 . The network device of claim 2 , wherein the packet grouping processor is further configured to:
generate each group descriptor to include only respective subsets of information taken from respective packet descriptors corresponding to packets that are members of the respective group of at least two packets.
6 . The network device of claim 2 , wherein the packet grouping processor is further configured to:
generate each group descriptor to include a respective quantity of packets in the respective group of at least two packets.
7 . The network device of claim 1 , wherein:
the packet buffer comprises a first packet memory and a second packet memory;
the receiver processor is configured to store in the first packet memory the packets that are received by the network device via the plurality of network interfaces;
the network device further comprises memory controller configured to transfer groups of packets from the first packet memory to the second packet memory, and to transfer the groups of packets from the second packet memory back to the first packet memory prior to the groups of packets being transmitted from the network device via the plurality of network interfaces; and
the transmit processor is configured to, in response to the single transmit decision, transfer the particular group of packets from the first packet memory to the corresponding network interface for transmission.
8 . The network device of claim 7 , wherein the packet grouping processor is configured to:
in connection with defining a particular group of at least two packets among packets stored in the packet buffer, control the memory controller to transfer the particular group of at least two packets from the first packet memory to the second packet memory.
9 . The network device of claim 7 , wherein the memory controller is configured to, as part of transferring groups of at least two packets from the second packet memory back to the first packet memory:
write each group of at least two packets to a respective set of consecutive memory locations in the first packet memory so that, when the group of at least two packets is to be transmitted from the network device, the transmit processor will read the group of packets from consecutive memory locations in the first packet memory.
10 . The network device of claim 7 , wherein the memory controller is configured to, as part of transferring groups of at least two packets from the second packet memory back to the first packet memory:
write a first packet in the group of at least two packets to a first memory location in the first packet memory and write a second packet in the group of at least two packets to a second memory location in the first packet memory that is non-consecutive with the first memory location so that, when the group of at least two packets is to be transmitted from the network device, the transmit processor will read the group of packets from non-consecutive memory locations in the first packet memory.
11 . The network device of claim 7 , wherein the memory controller is configured to, as part of transferring groups of at least two packets from the first packet memory to the second packet memory:
for each group of at least two packets, read packets that are members of the group from non-consecutive memory locations in the first packet memory; and
write each group of at least two packets to a respective set of consecutive memory locations in the second packet memory so that, when the group of at least two packets is to be transferred back to the first packet memory, the memory controller will read the group of packets from consecutive memory locations in the second packet memory.
12 . The network device of claim 1 , wherein the packet grouping processor is configured to, for each group of at least two packets:
replace the packet descriptors corresponding to the at least two packets in the FIFO queue with the group descriptor for the group.
13 . A method for processing packets at a network device, the method comprising:
storing in a packet buffer of the network device packets for transmission from the network device via a network interface of the network device;
generating, for each of at least some of the packets, a packet descriptor that includes metadata regarding the packet,
storing in a first-in-first-out (FIFO) queue of the network device packet descriptors;
defining, at the network device, groups of packets among packets being processed by the network device, each of at least some of the groups of packets including at least two packets, the defining of the groups of packets including, for each group of at least two packets, i) defining the group using packet descriptors a) corresponding to the at least two packets and b) stored in the FIFO queue, and ii) generating a respective group descriptor;
storing in the FIFO queue of the network device the group descriptors;
making respective single transmit decisions, at the network device, that respective groups of packets in the packet buffer are to be transmitted from the network device via the network interface, including making respective single transmit decisions that respective groups of at least two packets in the packet buffer are to be transmitted from the network device via the network interface, the making of each of at some of the single transmit decisions including dequeuing a respective group descriptor corresponding to the respective group from the FIFO queue; and
for each of at least some of the groups of packets in the packet buffer, transferring, by the network device, the corresponding group of packets to the network interface for transmission in response to dequeuing the corresponding group descriptor from the FIFO queue.
14 . The method for processing packets of claim 13 , further comprising:
wherein defining groups of packets comprises, for each group of at least two packets, generating the respective group descriptor to include metadata regarding the respective group of at least two packets, the metadata including information that specifies which packets are members of the respective group of packets.
15 . The method for processing packets of claim 14 , further comprising:
scheduling groups of packets for transmission via the network interface, including the storing of the group descriptors in the FIFO.
16 . The method for processing packets of claim 14 , wherein generating the respective group descriptor comprises:
generating the group descriptor to include respective packet descriptors corresponding to packets that are members of the respective group of packets.
17 . The method for processing packets of claim 14 , wherein generating the respective group descriptor comprises:
generating the group descriptor to include only respective subsets of information from respective packet descriptors corresponding to packets that are members of the respective group of at least two packets.
18 . The method for processing packets of claim 14 , wherein generating the respective group descriptor comprises:
generating the group descriptor to include a quantity of packets that are members of the respective group of packets.
19 . The method for processing packets of claim 13 , wherein:
the packet buffer comprises a first packet memory and a second packet memory;
storing packets for transmission in the packet buffer comprises storing the packets for transmission in the first packet memory;
transferring, by the network device, groups of at least two packets from the first packet memory to the second packet memory;
transferring, by the network device, the groups of at least two packets from the second packet memory back to the first packet memory prior to the groups of packets being transmitted from the network device via the plurality of network interfaces; and
transferring the corresponding group of at least two packets to the network interface for transmission in response to each single transmit decision comprises: in response to the single transmit decision, transferring the particular group of at least two packets from the first packet memory to the corresponding network interface for transmission.
20 . The method for processing packets of claim 19 , wherein transferring groups of at least two packets from the first packet memory to the second packet memory comprises:
in connection with defining a particular group of at least two packets among packets stored in the packet buffer, transferring the particular group of at least two packets from the first packet memory to the second packet memory.
21 . The method for processing packets of claim 19 , wherein transferring groups of at least two packets from the second packet memory back to the first packet memory comprises:
writing each group of at least two packets to a respective set of consecutive memory locations in the first packet memory so that, when the group of at least two packets is to be transmitted from the network device, the group of packets will be read from consecutive memory locations in the first packet memory.
22 . The method for processing packets of claim 19 , wherein transferring groups of at least two packets from the second packet memory back to the first packet memory comprises:
writing a first packet in the group of at least two packets to a first memory location in the first packet memory and writing a second packet in the group of at least two packets to a second memory location in the first packet memory that is non-consecutive with the first memory location so that, when the group of at least two packets is to be transmitted from the network device, the transmit processor will read the group of packets from non-consecutive memory locations in the first packet memory.
23 . The method for processing packets of claim 19 , wherein transferring groups of at least two packets from the first packet memory to the second packet memory comprises:
for each group of at least two packets, reading packets that are members of the group from non-consecutive memory locations in the first packet memory; and
writing each group of at least two packets to a respective set of consecutive memory locations in the second packet memory so that, when the group of at least two packets is to be transferred back to the first packet memory, the group of packets will be read from consecutive memory locations in the second packet memory.
24 . The method for processing packets of claim 13 , further comprising:
for each group of at least two packets, replacing packet descriptors corresponding to the at least two packets in the FIFO queue with the group descriptor for the group.