A method and a network node for traffic shaping of a packet switched network is presented, the network node being arranged for processing packets to be transmitted in the network according to at least: —a serial packet processing algorithm Aser providing a synchronized utilization of a set of at least one processing unit; and—a parallel packet processing algorithm Apar providing an at least partly unsynchronized utilization of the set of at least one processing unit; wherein—the processing of the packets corresponds to a total packet cost, which is cooperatively shared by the at least one processing unit of the set. The method further includes: —determining, when the processing according to the parallel packet processing algorithm A par is used for processing the packets, if shares of the total packet cost for one or more of the at least one processing units exceed a capacity to process packets for the at least one processing units, respectively, wherein each one of the shares corresponds to one or more packet; and—switching from the processing according to the parallel packet processing algorithm Apar to processing according to the serial packet processing algorithm Aser if the shares of the total packet cost for one or more of the at least one processing units, respectively, is determined to exceed the capacity.
展开▼