vpp接口數據結構

dpdk_device_t字段描述

lockp發送隊列鎖,當發送隊列個數少於線程個數時往port發包需要加鎖,lockp是一個數組,每個元素對應一個發送隊列,即每個發送隊列一把鎖

device_index爲port分配的index,每個port一個

vlib_hw_if_index該port對應的hw結構的索引

vlib_sw_if_index該port對應的sw結構的索引

per_interface_next_index通過插件設置的下一個節點的index,如果沒有設置該字段,默認下一個節點爲handoff

tx_vectors發包緩存(數組),每個線程一個,每個數組大小爲4096

rx_vectors收包緩存(數組),每個接收隊列一個,每個數組大小爲256

d_trace_bufferstrace用於存放mbuf數組

frames用於分發包用的數組,每個線程一個,目前暫未使用

dev_type設備類型:ETH、KNI、VHOST_USER

pmd驅動類型:THUNDERX、E1000EM、IGB、IGBVF、IXGBE、IXGBEVF、I40E、I40EVF、VIRTIO、VICE

cpu_socket該port所在的numa

admin_upport的管理狀態

promisc混雜模式

tx_q_usedport發送隊列個數

rx_q_usedport接收隊列個數

nb_rx_descport接收隊列大小(描述符個數)

nb_tx_descPort發送隊列大小(描述符個數)

cpu_socket_id_by_queue收每個接收隊列的核對應的socket

port_confport的配置

tx_conf發送隊列配置

kniKni口

kni_port_idKni口id

vu_if_id

vhost-user相關字段

vu_vhost_dev

vu_is_running

vu_intf

af_packet_port_idAF_PACKET口id

linkport狀態

time_last_link_update最近一次更新port狀態的時間

statsport的統計計數

last_stats上一次獲取的port的統計技術

last_cleared_stats上次清除的port的統計計數

xstatsport擴展統計

last_cleared_xstats上次清除的port的擴展統計計數

time_last_stats_update最近一次更新port統計計數的時間

port_typePort的類型:1G、10G、40G、BOND、SWITCH、NETMAP、AF_PACKET

efd_agentefd功能相關

need_txlock發包是否需要加鎖


ethernet_interface_t 字段描述

flag_changePort的管理狀態、混在模式等flag修改函數

driver_instance暫未使用

address[6]Port的mac地址


vnet_hw_interface_t字段描述

namehw接口名字

flagsHw接口狀態:

VNET_HW_INTERFACE_FLAG_LINK_UP

hw_addresshw接口mac地址

output_node_indexOutput節點的index

tx_node_indexTx節點的index

dev_class_index設備類型索引:dpdk_device_class.index

dev_instance設備實例索引:dpdk_device_t結構的索引

hw_class_indexhw接口類型索引:

ethernet_hw_interface_class.index

hw_instancehw接口類型實例索引:ethernet_interface_t結構的索引

hw_if_indexhw結構的索引

sw_if_indexSw結構的索引

max_rate_bits_per_sec每秒傳輸速率,暫未使用

min_supported_packet_bytes接口支持的最小包長,默認:64

max_supported_packet_bytes接口支持的最大包長,默認:9216

min_packet_bytes接口支持的最小包長,默認:64

max_packet_bytes接口支持的最大包長,默認:9216

per_packet_overhead_bytes額外的節點長度:20,目前沒看到有用

max_l3_packet_bytes[]三層的MRU/MTU值,默認:9000

sub_interface_sw_if_index_by_id子接口索引哈希表,key爲標籤值,value爲子接口索引

l2_if_count如果爲1,所有的包都走ethernet-input?

bond_infobond口用


vnet_sw_interface_t字段描述

typesw接口類型: HARDWARE、

SUB

flags標誌位:ADMIN_UP、PUNT、PROXY_ARP、UNNUMBERED、BOND_SLAVE

sw_if_indexsw接口索引

sup_sw_if_index父接口索引

unnumbered_sw_if_index無編號接口索引:

http://www.china-ccie.com/doc/

ip-unnumbered/ip-unnumbered_chs.html

link_speed鏈路速率,暫未使用

output_feature_bitmapOutput feature,暫時只有ipsec-output

hw_if_index/ sub聯合體,父接口時hw_if_index指向hw的索引,子接口時sub用來保存子接口相關信息



vnet_sub_interface_t字段描述

id標籤id

eth .outer_vlan_id外面標籤id

eth .inner_vlan_id內存標籤id

eth .raw_flags/eth .flags

標誌位:

no_tags:沒有tag

one_tag:有一個tag

two_tags:有兩個tag

dot1ad:0 = dot1q, 1=dot1ad

exact_match:

default_sub:默認子接口?

outer_vlan_id_any:匹配任意外層標籤,未實現

inner_vlan_id_any:匹配任意內層標籤,未實現



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章