A method for processing packets in a network device, the method comprising:
- receiving a first packet at the network device, the first packet being associated with a first bypass indicator that indicates i) a first bypass status for a first packet processing unit among a plurality of packet processing units of the network device, the plurality of packet processing units arranged in a serial processing pipeline configured to process packets received by the network device, respective ones of the packet processing units being configured to perform corresponding packet processing operations and ii) a second bypass status for a second packet processing unit among the plurality of packet processing units in the serial processing pipeline that is configured to process packets received by the network device, the second packet processing unit being disposed after the first packet processing unit in the serial processing pipeline;
- based at least in part on analyzing a value of the first bypass indicator for the first packet processing unit, causing a first packet descriptor associated with the first packet i) to be routed around at least a portion of the first packet processing unit so that the first packet descriptor entirely skips being processed by the at least the portion of the first packet processing unit and ii) to subsequently be merged with packet descriptors that did not skip being processed by the at least the portion of the first packet processing unit;
- based at least in part on analyzing the value of the first bypass indicator for the second packet processing unit, causing the first packet descriptor i) to be provided to at least a portion of the second packet processing unit so that the first packet descriptor does not skip being processed by the at least the portion of the second packet processing unit and ii) to subsequently be merged with packet descriptors that skipped being processed by the at least the portion of the second packet processing unit;
- receiving a second packet at the network device, the second packet being associated with a second bypass indicator different than the first bypass indicator;
- and
- based at least in part on analyzing a value of the second bypass indicator for the first packet processing unit, causing a second packet descriptor associated with the second packet to be provided to at least the portion of the first packet processing unit so that the second packet descriptor does not skip being processed by the at least the portion of the first packet processing unit.