close

1)Both Non-Napi and Napi driver will call the netif_receive_skb() function, Non-Napi driver will through the function of prcess_blocklog(),   Napi driver will through the function of polling function in device driver.

2)The netif_receive_skb() does the below tasks.  

 

netif_receive_skb  
#skb_bond():

allows a group of interfaces to be grouped together and be treated as a single interface. the frame was received blonged to the one such group, the skb->dev must be changed to the device in the group with the role of master.

 

#Give a copy of the frame to each register protocol sniffer: list each  packet handle in ptype_all which entry is added by dev_add_pack()

and then send skb into the function deliver_skb();

 

#handle_diverter():

Diverter allows the kernel to change the L2 destination MAC address of frames to the other hosts originally to the local host. besides skb->pkt_type must be changed to PACKERT_HOST.

 

# Give a copy of the frame to each L3 registerd protocol handler: list each  packet handle in

Non-ptype_all (&ptype_base[hash]), which entry is added by dev_add_pack()and then send skb into the function deliver_skb();

 

ingrass_path

#deliver_skb():

as we can see the diagram upper, this function is to devliver a copy to any registerd protocol handler.

ex: ip_rcv() is for ipv4 packets.

 

 

 

 

 
 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 horace papa 的頭像
    horace papa

    Horace papa's life

    horace papa 發表在 痞客邦 留言(0) 人氣()