【OVS2.5.0源码分析】bridge&bundle&port分析(1)

来源:互联网 发布:贵州省大数据登录 编辑:程序博客网 时间:2024/05/16 00:49

一、按照用途划分,openvswitch中桥、端口大致可以分成如下几类:

  1、配置管理

    主要对象包括:bridge、port、interface。

  2、openflow

    主要对象包括:ofproto、ofproto_dpif、ofbundle、ofport、ofport_dpif。

  3、端口镜像

    主要对象包括:mbridge、mbundle。

  4、upcall处理

    主要对象包括:xbridge、xbundle、xport。


二、各对象之间的关系


三、各对象生成时间

  1、ofproto创建路径(实际为ofproto_dpif对象)

     bridge_run->bridge_reconfigure->ofproto_create->alloc

  2、ofbundle创建路径

    bridge_run->bridge_reconfigure->port_configure->ofproto_bundle_register->bundle_set

  3、ofport创建路径

    bridge_run->bridge_reconfigure->ofproto_create-> alloc

  4、xbridge创建路径

    bridge_run->bridge_run__->ofproto_type_run->type_run->xlate_ofproto_set

  5、xbundle创建路径

    bridge_run->bridge_run__->ofproto_type_run->type_run->xlate_bundle_set

  6、xport创建路径

    bridge_run->bridge_run__->ofproto_type_run->type_run->xlate_ofport_set

  7、mbridge创建路径

    bridge_run->bridge_reconfigure->ofproto_create->alloc  //与ofproto相同,ofproto对象创建时会同时创建mbridge对象

  8、mbundle创建路径

    bridge_run->bridge_reconfigure->port_configure->ofproto_bundle_register->bundle_set  //与ofbundle相同,创建ofbundle时会同时创建mbundle对象


创建类似多个对象目前看到的一个好处是模块之间耦合度低!

0 0