1 from vpp_interface import VppInterface
4 class VppVhostInterface(VppInterface):
5 """VPP vhost interface."""
7 def __init__(self, test, sock_filename, is_server=0, renumber=0,
8 disable_mrg_rxbuf=0, disable_indirect_desc=0, enable_gso=0,
9 enable_packed_ring=0, enable_event_idx=0,
10 custom_dev_instance=0xFFFFFFFF, use_custom_mac=0,
11 mac_address='', tag=''):
13 """ Create VPP Vhost interface """
14 super(VppVhostInterface, self).__init__(test)
15 self.is_server = is_server
16 self.sock_filename = sock_filename
17 self.renumber = renumber
18 self.disable_mrg_rxbuf = disable_mrg_rxbuf
19 self.disable_indirect_desc = disable_indirect_desc
20 self.enable_gso = enable_gso
21 self.enable_packed_ring = enable_packed_ring
22 self.enable_event_idx = enable_event_idx
23 self.custom_dev_instance = custom_dev_instance
24 self.use_custom_mac = use_custom_mac
25 self.mac_address = mac_address
28 def add_vpp_config(self):
29 r = self.test.vapi.create_vhost_user_if_v2(self.is_server,
32 self.disable_mrg_rxbuf,
33 self.disable_indirect_desc,
35 self.enable_packed_ring,
36 self.enable_event_idx,
37 self.custom_dev_instance,
41 self.set_sw_if_index(r.sw_if_index)
43 def remove_vpp_config(self):
44 self.test.vapi.delete_vhost_user_if(self.sw_if_index)
46 def is_interface_config_in_dump(self, dump):
48 if i.sw_if_index == self.sw_if_index: