Merge "reset driver using bind/unbind when vm is deleted"
This commit is contained in:
commit
333459c2b2
|
@ -37,7 +37,8 @@ CX4_GUID_PORT_PATH = ('/sys/class/infiniband/%(module)s/device/sriov/'
|
||||||
'%(vf_num)s/port')
|
'%(vf_num)s/port')
|
||||||
CX4_GUID_POLICY_PATH = ('/sys/class/infiniband/%(module)s/device/sriov/'
|
CX4_GUID_POLICY_PATH = ('/sys/class/infiniband/%(module)s/device/sriov/'
|
||||||
'%(vf_num)s/policy')
|
'%(vf_num)s/policy')
|
||||||
|
UNBIND_PATH = '/sys/bus/pci/drivers/mlx5_core/unbind'
|
||||||
|
BIND_PATH = '/sys/bus/pci/drivers/mlx5_core/bind'
|
||||||
|
|
||||||
INVALID_GUID_CX3 = 'ffffffffffffffff'
|
INVALID_GUID_CX3 = 'ffffffffffffffff'
|
||||||
INVALID_GUID_CX4 = 'ff:ff:ff:ff:ff:ff:ff:ff'
|
INVALID_GUID_CX4 = 'ff:ff:ff:ff:ff:ff:ff:ff'
|
||||||
|
|
|
@ -316,8 +316,16 @@ class eSwitchHandler(object):
|
||||||
cmd = ['ebrctl', 'write-sys', path, vguid]
|
cmd = ['ebrctl', 'write-sys', path, vguid]
|
||||||
command_utils.execute(*cmd)
|
command_utils.execute(*cmd)
|
||||||
|
|
||||||
cmd = ['ebrctl', 'write-sys', guid_poliy, 'Up\n']
|
if vguid == constants.INVALID_GUID_CX4:
|
||||||
command_utils.execute(*cmd)
|
cmd = ['ebrctl', 'write-sys', guid_poliy, 'Down\n']
|
||||||
|
command_utils.execute(*cmd)
|
||||||
|
cmd = ['ebrctl', 'write-sys', constants.UNBIND_PATH, dev]
|
||||||
|
command_utils.execute(*cmd)
|
||||||
|
cmd = ['ebrctl', 'write-sys', constants.BIND_PATH, dev]
|
||||||
|
command_utils.execute(*cmd)
|
||||||
|
else:
|
||||||
|
cmd = ['ebrctl', 'write-sys', guid_poliy, 'Up\n']
|
||||||
|
command_utils.execute(*cmd)
|
||||||
|
|
||||||
def _config_vlan_ib(self, fabric, dev, vlan):
|
def _config_vlan_ib(self, fabric, dev, vlan):
|
||||||
fabric_details = self.rm.get_fabric_details(fabric)
|
fabric_details = self.rm.get_fabric_details(fabric)
|
||||||
|
|
Loading…
Reference in New Issue