Fixed CX5 device_type handling

Change-Id: I925a5c5799f0c9957f62131a0220e05fbe7a5c37
This commit is contained in:
Lenny Verkhovsky 2016-11-30 13:15:42 +00:00
parent 05e6c762e5
commit 180c5f7b22
2 changed files with 7 additions and 4 deletions

View File

@ -261,7 +261,8 @@ class eSwitchHandler(object):
prefix = mac[:6]
suffix = mac[6:]
guid = prefix + '0000' + suffix
elif device_type == constants.CX4_VF_DEVICE_TYPE:
elif (device_type == constants.CX4_VF_DEVICE_TYPE or
device_type == constants.CX5_VF_DEVICE_TYPE):
if mac is None:
guid = constants.INVALID_GUID_CX4
else:
@ -276,7 +277,8 @@ class eSwitchHandler(object):
vguid = self._get_guid_from_mac(vnic_mac, vf_device_type)
if vf_device_type == constants.CX3_VF_DEVICE_TYPE:
self._config_vf_mac_address_cx3(vguid, dev, fabric_details)
elif vf_device_type == constants.CX4_VF_DEVICE_TYPE:
elif (vf_device_type == constants.CX4_VF_DEVICE_TYPE or
vf_device_type == constants.CX5_VF_DEVICE_TYPE):
self._config_vf_mac_address_cx4(vguid, dev, fabric_details)
else:
LOG.error(_LE("Unsupported vf device type: %s "),

View File

@ -104,8 +104,9 @@ class ResourceManager(object):
pf_mlx_dev = fabric_details['pf_mlx_dev']
vf_index = self.pci_utils.get_guid_index(pf_mlx_dev, dev,
hca_port)
elif fabric_details['pf_device_type'] == \
constants.CX4_VF_DEVICE_TYPE:
elif fabric_details['pf_device_type'] in \
[constants.CX4_VF_DEVICE_TYPE,
constants.CX5_VF_DEVICE_TYPE]:
vf_index = fabric_details['vfs'][dev]['vf_num']
try:
mac = self.macs_map[fabric][str(vf_index)]