• OpenvSwitch 代码笔记


    此处主要记录OpenvSwitch 功能实现的调用过程:

     

    注册用户态接收包时回调函数:
                                              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
    

      

    用户态Datapath处理packet流程:
            pmd_thread_main           dpif_netdev_run
                                           /
                                         /
                    dp_netdev_process_rxq_port
                               |
                          dp_netdev_input
                               |
                         fast_path_processing
                               |
                        handle_packet_upcall
                           /             
                     (2) /                 (1)
                       /                     
      dp_netdev_execute_actions       dp_netdev_upcall
                      |                         |
             odp_execute_actions             upcall_cb(调用注册的回调函数)
                      |
                dp_execute_cb
                      |
                 netdev_send
    

     

  • 相关阅读:
    微信小程序,答题问卷,单选,多选混合在一个借口,前端怎么循环
    react 从0到1
    react从0到0
    es6 系统总结
    点击页面的某个元素,弹出这个元素的索引(是第几个)
    js return的用法
    安装golang.org/x/*
    完美解决从github上下载东西慢的方法
    初探golang和应用其框架 gin 的 使用教程(一)安装篇
    CentOS7安装go开发环境
  • 原文地址:https://www.cnblogs.com/gaozhengwei/p/9021124.html
Copyright © 2020-2023  润新知