Download Using Time Division Multiplexing to support Real
Transcript
out to be transmitted through the driver specific routines. Step 11 : In case the network device is not free to transmit the packet, the packet is requeued again for processing at a further time. The scheduler calls the netif schedule [include/linux/netdevice.h] function which raises the NET TX SOFTIRQ, which would take care of the packet processing at the earliest available time. Network Device Driver Layer Step 12 : The hard start xmit [drivers/net/device.c] function is an inter- face to the device driver specific implementation used to prepare a packet for transmission and send it out. Step 13 : The device specific routines are then invoked to do the transmission. The packet is sent out to the output medium by calling the I/O instructions to copy the packet to the hardware and start the transmission. Once the packet is transmitted, it also frees the socket buffer space occupied by the packet and records the time when the transmission took place. Step 14 : Once the device finishes sending the packet out it raises an interrupt to inform the system that it has finished sending the packet. If the socket buffer is not free at this point in time, then it is freed. It then calls the netif wake queue [include/linux/netdevice.h], which is basically to inform the system that the device is free for sending further packets. This function in turn invokes netif schedule to raise the transmit softirq to schedule the transmission of the next packet. 3.5.3 Packet Reception in the Linux Network Stack The control flow for receiving a packet from the network stack follows two flows of execution. One from the user program in the application layer to the transport layer, where the process blocks waiting to read from the queue of incoming packets. The execution in this flow is carried out in the process context. The other is the flow from the 28