def update_vpp_vif_port(dev, mtu=None, interface_type=None, timeout=None): if not mtu: return vapi = VPPApi(LOG, 'nova_os_vif') _, _, sw_if_index = vapi.vhost_details_from_tag( dev.port_profile.interface_id) vapi.set_interface_mtu(sw_if_index, mtu)
def get_vif_port_by_id(self, tag): vapi = VPPApi(LOG, 'gbp-agent') port_name, mac, _ = vapi.vhost_details_from_tag(tag) # Create a fake port object for compatibility within # gbp agent. class Port(object): pass port_obj = Port() port_obj.vif_id = tag port_obj.vif_mac = mac port_obj.ofport = -1 port_obj.port_name = port_name return port_obj