summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-12-04 11:36:21 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2018-12-12 14:18:53 +0100
commit529533a50c01fec36e91134c1c44c6b00ef25fd4 (patch)
tree4b0159979b897cf849b8959bdddc8b818c2c7ba6
parent75024e11b395e5d4910efc407be09e76b6c6ff7c (diff)
downloadNetworkManager-529533a50c01fec36e91134c1c44c6b00ef25fd4.tar.gz
device: reset SR-IOV VFs on deactivation
If the connection has a sriov setting we configure SR-IOV VFs on activation. We should also clear resources when the connection deactivates.
-rw-r--r--src/devices/nm-device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 7e1973eb82..e402857244 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -14732,6 +14732,7 @@ _set_state_full (NMDevice *self,
NMActRequest *req;
gboolean no_firmware = FALSE;
NMSettingsConnection *sett_conn;
+ NMSettingSriov *s_sriov;
g_return_if_fail (NM_IS_DEVICE (self));
@@ -14930,6 +14931,12 @@ _set_state_full (NMDevice *self,
}
break;
case NM_DEVICE_STATE_DEACTIVATING:
+ if ( (s_sriov = nm_device_get_applied_setting (self, NM_TYPE_SETTING_SRIOV))
+ && priv->ifindex > 0) {
+ nm_platform_link_set_sriov_params (nm_device_get_platform (self),
+ priv->ifindex, 0, 1);
+ }
+
_cancel_activation (self);
/* We cache the ignore_carrier state to not react on config-reloads while the connection