def plug_hw_veb(self, instance, vif): if vif['vnic_type'] == network_model.VNIC_TYPE_MACVTAP: linux_net.set_vf_interface_vlan( vif['profile']['pci_slot'], mac_addr=vif['address'], vlan=vif['details'][network_model.VIF_DETAILS_VLAN]) # add by bob if CONF.acc.nic_vender == 'netronome' or CONF.acc.nic_vender == 'Netronome': bridge = CONF.acc.ovs_bridge netro = NetronomeResourceManage(bridge_name=bridge) port_name = netro.get_port_name_by_pci_slot( vif['profile']['pci_slot']) port_id = netro.get_port_id(port_name) iface_id = self.get_ovs_interfaceid(vif) mtu = vif['network'].get_meta('mtu') if port_name: linux_net.create_ovs_vif_port(bridge, port_name, iface_id, vif['address'], instance.uuid, mtu) LOG.debug("Success add port:%s on bridge:%s" % (port_name, bridge)) netro.bind_port(port_id, iface_id, instance.uuid) else: LOG.debug("Fail add port on bridge:%s with pci_slot:%s" % (bridge, vif['profile']['pci_slot']))
def unplug_hw_veb(self, instance, vif): if vif['vnic_type'] == network_model.VNIC_TYPE_MACVTAP: # The ip utility doesn't accept the MAC 00:00:00:00:00:00. # Therefore, keep the MAC unchanged. Later operations on # the same VF will not be affected by the existing MAC. linux_net.set_vf_interface_vlan(vif['profile']['pci_slot'], mac_addr=vif['address'])
def plug_hw_veb(self, instance, vif): # TODO(vladikr): This code can be removed once the minimum version of # Libvirt is incleased above 1.3.5, as vlan will be set by libvirt if vif['vnic_type'] == network_model.VNIC_TYPE_MACVTAP: linux_net.set_vf_interface_vlan( vif['profile']['pci_slot'], mac_addr=vif['address'], vlan=vif['details'][network_model.VIF_DETAILS_VLAN])
def unplug_hw_veb(self, instance, vif): # TODO(vladikr): This code can be removed once the minimum version of # Libvirt is incleased above 1.3.5, as vlan will be set by libvirt if vif['vnic_type'] == network_model.VNIC_TYPE_MACVTAP: # The ip utility doesn't accept the MAC 00:00:00:00:00:00. # Therefore, keep the MAC unchanged. Later operations on # the same VF will not be affected by the existing MAC. linux_net.set_vf_interface_vlan(vif['profile']['pci_slot'], mac_addr=vif['address'])
def unplug_hw_veb(self, instance, vif): if vif['vnic_type'] == network_model.VNIC_TYPE_MACVTAP: # The ip utility doesn't accept the MAC 00:00:00:00:00:00. # Therefore, keep the MAC unchanged. Later operations on # the same VF will not be affected by the existing MAC. linux_net.set_vf_interface_vlan(vif['profile']['pci_slot'], mac_addr=vif['address']) # add by bob if CONF.acc.nic_vender == 'netronome' or CONF.acc.nic_vender == 'Netronome': bridge = CONF.acc.ovs_bridge netro = NetronomeResourceManage(bridge_name=bridge) port_name = netro.get_port_name_by_pci_slot( vif['profile']['pci_slot']) if port_name: linux_net.delete_ovs_vif_port(bridge, port_name, False) LOG.debug("Success delete port:%s on bridge:%s" % (port_name, bridge)) port_id = netro.get_port_id(port_name) netro.unbind_port(port_id)
def plug_hw_veb(self, instance, vif): if vif['vnic_type'] == network_model.VNIC_TYPE_MACVTAP: linux_net.set_vf_interface_vlan( vif['profile']['pci_slot'], mac_addr=vif['address'], vlan=vif['details'][network_model.VIF_DETAILS_VLAN])
def plug_hw_veb(self, instance, vif): if vif["vnic_type"] == network_model.VNIC_TYPE_MACVTAP: linux_net.set_vf_interface_vlan( vif["profile"]["pci_slot"], mac_addr=vif["address"], vlan=vif["details"][network_model.VIF_DETAILS_VLAN] )