Packet reception:
DMA packet memory copy is completed -> NIC hardware interrupt ISR is invoked -> Receive interrupt detected -> gather the buffer containing raw packet into a socket buffer (avoid coping: we can set up socket buffer to point directly at DMA space.) -> place packet onto queue (by protocol input function) -> Queuing layer kicks in -> softIRQ threads to process the scheduled interface
Packet transmission:
(Based on registered queuing discipline and scheduler) Queuing layer (dev_queue_xmit) invokes Hard_start_xmit -> Hard_start_xmit checks hardware buffer -> Hard_start_xmit puts socket buffer in driver's local queue and enable the Transmit Interrupt
Status notifier chain: This is really just a linkedlist of functions to be called on event for notification, nice and simple (to my like). Registering is actually appending callback function point to the list in this case. netdev_chain is the implementation for NIC.
As a bonus for whoever is reading this, the following are comments for in the include/linux/netdevice.h
/*
* The DEVICE structure.
* Actually, this whole structure is a big mistake. It mixes I/O
* data with strictly "high-level" data, and it has to know about
* almost every data structure used in the INET module.
*
* FIXME: cleanup struct net_device such that network protocol info
* moves out.
*/
struct net_device {...}
No comments:
Post a Comment