1. Interrupt processing function:
NIC receives a frame ------------------------>
Start interrupt ------------------->
CPU calls the corresponding interrupt processing function (pointing to the corresponding processing function in this network card) (read this packet into the RAM) ------------------>
Call the Netif_RX function to play TimeStamp and put this SKB into the queue set by the CPU --------------->
Marker Soft Interrupt (__CPU_RAISE_SOFTIRQ) --------------------> Interrupt is completed.
2. When the soft interrupt is called (a total of three local calls), call net_rx_softirq (actually the NET_RX_ACTION () function) handles the network's soft interrupt. ----------------->
NET_RX_ACTION () Find the corresponding protocol in the array ptype_base [16] according to the protocol type of the packet, and knows the received processing function, then pay the data package to the processing function, which is handed over to the upper processing, actual call processing The function is in the pt_prev-> func () in NET_RX_ACTION (). For example, if the packet is an IP protocol, ptype_base [eth_p_ip] -> func () (ip_rcv ()), then hand it over to the IP protocol. According to the type of package, find the corresponding package processing function registered in the system, for IPv4 IP packets, call IP_rcv -----------> nf_ip_pre_routing ---------- ---->
IP_RCV_FINISH (Routing operation for this package) -------------------->
According to the result of the route, call ip_local_deliver (given the package) / ip_forwardd (to forward package) / ip_error () (error package) / ip_mr_input () ip_forward: Pack for forwarding , Check TTL, MTU, Call nf_ip_forwards, -------------->
IP_forwmard_finish (Check Other IP Options for ForwardD!) ------------------->
IP_send (if a fragmentation is required, call ip_fragment, otherwise call ip_finish_output () (Call Nf_ip_post_routing, then IP_FINISH_OUTPUT2 (Plug Link Link Link Terminal to SKB Structure) ------------>
hh-> hh_output / dsr-> neighbour-> Output