Fix VXLAN iSER Bond issue

Change-Id: Ide0763d3a44c84019e2f8aab88a15f053bd1d1bf
This commit is contained in:
Hamdy Khader 2016-09-29 12:30:53 +03:00
parent fc918d5ce2
commit f6a6cb4a4e
1 changed files with 14 additions and 3 deletions

View File

@ -105,7 +105,6 @@ class MellanoxSettings(object):
drivers_set = list(set(drivers))
interfaces_set = list(set(interfaces))
if (len(drivers_set) > 1):
logging.error("Multiple ConnectX adapters was found in this environment.")
raise MellanoxSettingsException(
@ -124,6 +123,8 @@ class MellanoxSettings(object):
mlnx['cx_card'] = 'none'
logging.error('Failed executing ibdev2netdev')
return 0
if ('bonds' in cls.data and mellanox_interface.startswith('bond')):
mellanox_interface = cls.data['bonds'][mellanox_interface]['interfaces'][0]
interface_line = [l for l in ibdev if mellanox_interface in l]
if interface_line and 'mlx5' in interface_line.pop():
mlnx['cx_card'] = 'ConnectX-4'
@ -167,7 +168,16 @@ class MellanoxSettings(object):
)
mlnx['physical_port'] = interfaces[private_ifc]['vendor_specific']['bus_info']
elif mlnx['driver'] == MLNX_DRIVERS_LIST[mlnx['cx_card']]['eth_driver']:
mlnx['physical_port'] = private_ifc
# If only iSER
if not cls.is_sriov_enabled() and cls.is_iser_enabled():
mlnx = cls.get_mlnx_section()
storage_ifc = cls.get_interface_by_network('storage')
mlnx['physical_port'] = storage_ifc
# If SR-IOV
else:
mlnx['physical_port'] = private_ifc
@classmethod
def add_storage_vlan(cls):
@ -483,7 +493,7 @@ class MellanoxSettings(object):
cls.data['bonds'][interface]['driver']
if ( network_type == 'private' and cls.is_sriov_enabled() ) or \
( network_type == 'storage' and cls.is_iser_enabled() ):
# Assign SR-IOV/ISER to the first port only.
# This is a temporary workaround until supporing bond over VFs.
# We sort the array of interfaces in order to get the first
@ -522,3 +532,4 @@ def main():
if __name__ == '__main__':
main()