一、按照用途劃分,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對象
創建類似多個對象目前看到的一個好處是模塊之間耦合度低!
原文鏈接:https://blog.csdn.net/one_clouder/article/details/52175828