From 2f012d80d771b5ca95dabce0f628393395c800eb Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 5 Jan 2016 14:43:57 +0100 Subject: [PATCH] device/infiniband: take interface down to set transport mode With some drivers it is necessary to take the interface down to set the transport mode. https://bugzilla.redhat.com/show_bug.cgi?id=1281301 (cherry picked from commit 5bf0697f659b262d7d385ff5903f3b86611a8c35) --- src/devices/nm-device-infiniband.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index c1571fd910..c21a52acb2 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -82,7 +82,7 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) NMSettingInfiniband *s_infiniband; const char *transport_mode; char *mode_path; - gboolean ok; + gboolean ok, no_firmware = FALSE; g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); @@ -113,8 +113,11 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) } } + /* With some drivers the interface must be down to set transport mode */ + nm_device_take_down (dev, TRUE); ok = nm_platform_sysctl_set (NM_PLATFORM_GET, mode_path, transport_mode); g_free (mode_path); + nm_device_bring_up (dev, TRUE, &no_firmware); if (!ok) { *reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED;