主权项 |
1. A data processing method, wherein the method is applied to user space of an operating system, the method comprising:
receiving a data packet from an input port on a network interface; storing the received data packet in memory space, wherein the memory space is memory space after memory mapping, and the memory space is accessible in both user mode and kernel mode; determining, according to an attribute of the data packet, a first protocol stack that needs to perform protocol processing on the data packet, wherein the first protocol stack is one of M protocol stacks, the M protocol stacks are disposed in the user space of the operating system, and each of the M protocol stacks separately runs on a logic core of a processor, M is a positive integer greater than 1; and inserting a pointer into an input queue corresponding to the first protocol stack, wherein the pointer points to an address of the data packet in the memory space, so that the first protocol stack retrieves the data packet from the memory space and performs protocol processing on the data packet according to a protocol processing rule. |