摘要 |
K classifiers and S network service processors are deployed in a network device. A network adapter receiving queue is divided into multiple queue areas. Each classifier may acquire a packet identifier from a queue area that corresponds to the classifier and is in the network adapter receiving queue, that is, the network adapter receiving queue has multiple information reading interfaces such that the K classifiers may concurrently read packet identifiers from corresponding queue areas in the network adapter receiving queue, and the K classifiers may further concurrently determine, based on the packet identifiers acquired by the K classifiers, corresponding flow queue identifiers. Related operations before the K classifiers distribute packet description information to flow queues may all be concurrently executed, and concurrent execution makes processing times of the related operations become partially or completely overlapped. |
主权项 |
1. A packet processing method applied to a network device, wherein K classifiers and S network service processors are loaded into a memory of the network device, wherein the K classifiers comprise a classifier x and a classifier y, wherein K and S are integers greater than 1, and wherein the method comprises:
acquiring, by the classifier x, P packet identifiers from a queue area a corresponding to the classifier x and is in a network adapter receiving queue; acquiring, by the classifier x and based on the P packet identifiers, P packets corresponding to the P packet identifiers; determining, by the classifier x and based on the P packets, flow queue identifiers corresponding to the P packets; distributing, by the classifier x, packet description information corresponding to the P packets to flow queues corresponding to the determined flow queue identifiers corresponding to the P packets, wherein packet description information corresponding to a packet i in the P packets is distributed to a flow queue corresponding to a determined flow queue identifier corresponding to the packet i, wherein the packet i is any one packet in the P packets, and wherein the packet description information corresponding to the packet i comprises a packet identifier of the packet i; processing, by Si network service processors in the S network service processors and based on the packet description information corresponding to the P packets and is distributed to the flow queues, the P packets; sending the P processed packets; acquiring, by the classifier y, Q packet identifiers from a queue area b corresponding to the classifier y and is in the network adapter receiving queue; acquiring, by the classifier y and based on the Q packet identifiers, Q packets corresponding to the Q packet identifiers; determining, by the classifier y and based on the Q packets, flow queue identifiers corresponding to the Q packets; distributing, by the classifier y after the classifier x distributes the packet description information corresponding to the P packets to the flow queues corresponding to the determined flow queue identifiers corresponding to the P packets, packet description information corresponding to the Q packets to flow queues corresponding to the determined flow queue identifiers corresponding to the Q packets, wherein packet description information corresponding to a packet m in the Q packet is distributed to a flow queue corresponding to a determined flow queue identifier corresponding to the packet m, wherein the packet m is any one packet in the Q packets, wherein the packet description information corresponding to the packet m comprises a packet identifier of the packet m, wherein Q and P are positive integers, and wherein a time at which the Q packets are enqueued to the queue area b in the network adapter receiving queue is later than a time at which the P packets are enqueued to the queue area a in the network adapter receiving queue; processing, by Sj network service processors in the S network service processors and based on the packet description information corresponding to the Q packets and is distributed to the flow queues, the Q packets; and sending the Q processed packets, wherein an intersection set between the Si network service processors and the Sj network service processors is a null set or a non-null set. |