Merge "Enable data interface if vswitch is unaccelerated"
This commit is contained in:
commit
524c62c426
@ -134,6 +134,7 @@ class InterfacePuppet(base.BasePuppet):
|
|||||||
'gateways': self._get_gateway_index(),
|
'gateways': self._get_gateway_index(),
|
||||||
'floatingips': self._get_floating_ip_index(),
|
'floatingips': self._get_floating_ip_index(),
|
||||||
'datanets': self._get_datanetworks(host),
|
'datanets': self._get_datanetworks(host),
|
||||||
|
'vswitchtype': self._vswitch_type(),
|
||||||
}
|
}
|
||||||
return context
|
return context
|
||||||
|
|
||||||
@ -314,6 +315,15 @@ def is_worker_subfunction(context):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def is_vswitch_type_unaccelerated(context):
|
||||||
|
"""
|
||||||
|
Determine if the underlying device vswitch type is unaccelerated.
|
||||||
|
"""
|
||||||
|
if context['vswitchtype'] == constants.VSWITCH_TYPE_NONE:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def is_pci_interface(iface):
|
def is_pci_interface(iface):
|
||||||
"""
|
"""
|
||||||
Determine if the interface is one of the PCI device types.
|
Determine if the interface is one of the PCI device types.
|
||||||
@ -615,17 +625,19 @@ def get_interface_address_method(context, iface, network_id=None):
|
|||||||
"""
|
"""
|
||||||
networktype = find_networktype_by_network_id(context, network_id)
|
networktype = find_networktype_by_network_id(context, network_id)
|
||||||
|
|
||||||
if not iface.ifclass or iface.ifclass == constants.INTERFACE_CLASS_NONE \
|
if iface.ifclass == constants.INTERFACE_CLASS_DATA:
|
||||||
|
if is_vswitch_type_unaccelerated(context):
|
||||||
|
return STATIC_METHOD
|
||||||
|
# All data interfaces configured in the kernel because they are not
|
||||||
|
# natively supported in vswitch or need to be shared with the kernel
|
||||||
|
# because of a platform VLAN should be left as manual config
|
||||||
|
return MANUAL_METHOD
|
||||||
|
elif not iface.ifclass or iface.ifclass == constants.INTERFACE_CLASS_NONE \
|
||||||
or not networktype:
|
or not networktype:
|
||||||
# Interfaces that are configured purely as a dependency from other
|
# Interfaces that are configured purely as a dependency from other
|
||||||
# interfaces (i.e., vlan lower interface, bridge member, bond slave)
|
# interfaces (i.e., vlan lower interface, bridge member, bond slave)
|
||||||
# should be left as manual config
|
# should be left as manual config
|
||||||
return MANUAL_METHOD
|
return MANUAL_METHOD
|
||||||
elif iface.ifclass == constants.INTERFACE_CLASS_DATA:
|
|
||||||
# All data interfaces configured in the kernel because they are not
|
|
||||||
# natively supported in vswitch or need to be shared with the kernel
|
|
||||||
# because of a platform VLAN should be left as manual config
|
|
||||||
return MANUAL_METHOD
|
|
||||||
elif iface.ifclass in PCI_INTERFACE_CLASSES:
|
elif iface.ifclass in PCI_INTERFACE_CLASSES:
|
||||||
return MANUAL_METHOD
|
return MANUAL_METHOD
|
||||||
else:
|
else:
|
||||||
@ -704,6 +716,10 @@ def needs_interface_config(context, iface):
|
|||||||
elif not is_worker_subfunction(context):
|
elif not is_worker_subfunction(context):
|
||||||
return False
|
return False
|
||||||
elif is_data_interface(context, iface):
|
elif is_data_interface(context, iface):
|
||||||
|
if is_vswitch_type_unaccelerated(context):
|
||||||
|
# a platform interface configuration will use the host interface when
|
||||||
|
# the vswitch is unaccelerated.
|
||||||
|
return True
|
||||||
if not is_dpdk_compatible(context, iface):
|
if not is_dpdk_compatible(context, iface):
|
||||||
# vswitch interfaces for devices that are not natively supported by
|
# vswitch interfaces for devices that are not natively supported by
|
||||||
# the DPDK are created as regular Linux devices and then bridged in
|
# the DPDK are created as regular Linux devices and then bridged in
|
||||||
|
Loading…
Reference in New Issue
Block a user