OVS 各功能调用过程(三十一)

注册用户态接收包时回调函数:
                                          construct
                                              |
                                              |
                                     open_dpif_backer
                                     /               \
                      (dpif-netdev) /                  \(dpif-net-link)
                                   /                    \
                            udpif_create                  udpif_set_threads
                                 |                                |
                       dpif_register_upcall_cb            udpif_start_threads
                                 |                                |
                   dpif_netdev_register_upcall_cb         ovs_thread_create
                                                                   |
                                                          udpif_upcall_handler (* 接收到内核态的请求)
                                                                   |
                                                               recv_upcalls
                                                                /          \
                                                          (2)  /             \ (1)
                                                              /                \
                                                     upcall_receive          dpif_recv
                                                             |                    |
                                                       flow_extract         dpif_netlink_recv
                                                             |
                                                       process_upcall
                                                             |
                                                       upcall_xlate
                                                             |
                                                       xlate_actions
处理controller发送的packetout数据包:

                                      ofconn_run
                                           |
                                     handle_openflow
                                           |
                                     handle_packet_out
                                       /               \
                                 (2) /                   \(1)
                                   /                       \
                 ofproto_packet_out_finish              ofproto_packet_out_start
                               |                                           |
                       packet_execute                                  packet_xlate
                               |                                           |
                         dpif_execute                                  xlate_actions
                               |                                           |
                        dpif_operate                              rule_dpif_lookup_from_table
           (dpif-netdev) /          \(dpif-netlink)                        |
                       /              \                              rule_dpif_lookup_in_table
           dpif_netdev_operate    dpif_netlink_operate                  /              \
                    |                        |                    (2) /                  \(1)
           dpif_netdev_execute  dpif_netlink_encode_execute         /                      \
                    |                        |                do_xlate_actions            classifier_lookup
     dp_netdev_execute_actions         nl_msg_put_genlmsghdr         |                           |
                    |                                         xlate_output_action         find_match_wc
           odp_execute_actions                                       |
                    |                                           compose_output_action
             dp_execute_cb                                            |
                    |                                           nl_msg_put_odp_port
                netdev_send
内核态Datapath处理packet流程:

            netdev_frame_hook
                     |
            netdev_port_receive
                     |
            ovs_vport_receive
                     |
           ovs_dp_process_packet
               /              \
 (Normal Match)/                \ (Non-normal Match)
             /                   \
   ovs_execute_actions         ovs_dp_upcall
                                   |
                            queue_userspace_packet
                                   |
                           genlmsg_unicast

原文链接:https://my.oschina.net/u/4265555/blog/3977912/print

你可能感兴趣的:(系统)