summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-03-20 12:39:44 -0500
committerDan Williams <dcbw@redhat.com>2014-03-25 22:46:59 -0500
commitebc06a001582b780ee29ab4eea838042300b46aa (patch)
tree030e3720a34519077662154e1ebae854ff7b0f04 /src
parent32670b52647046536f876b974480059a3d2c4c02 (diff)
downloadNetworkManager-ebc06a001582b780ee29ab4eea838042300b46aa.tar.gz
dcb: turn off all DCB features when disabling DCB
Don't just disable DCB, but turn off the features too.
Diffstat (limited to 'src')
-rw-r--r--src/nm-dcb.c22
-rw-r--r--src/tests/test-dcb.c8
2 files changed, 27 insertions, 3 deletions
diff --git a/src/nm-dcb.c b/src/nm-dcb.c
index cef7ed9932..d937d341dc 100644
--- a/src/nm-dcb.c
+++ b/src/nm-dcb.c
@@ -228,8 +228,26 @@ _dcb_cleanup (const char *iface,
gpointer user_data,
GError **error)
{
- /* FIXME: do we need to turn off features individually here? */
- return do_helper (iface, DCBTOOL, run_func, user_data, error, "dcb off");
+ const char *cmds[] = {
+ "dcb off",
+ "app:fcoe e:0",
+ "app:iscsi e:0",
+ "app:fip e:0",
+ "pfc e:0",
+ "pg e:0",
+ NULL
+ };
+ const char **iter = cmds;
+ gboolean success = TRUE;
+
+ /* Turn everything off and return first error we get (if any) */
+ while (iter && *iter) {
+ if (!do_helper (iface, DCBTOOL, run_func, user_data, success ? error : NULL, *iter))
+ success = FALSE;
+ iter++;
+ }
+
+ return success;
}
gboolean
diff --git a/src/tests/test-dcb.c b/src/tests/test-dcb.c
index c950ac6d0b..5763507f2e 100644
--- a/src/tests/test-dcb.c
+++ b/src/tests/test-dcb.c
@@ -268,7 +268,13 @@ static void
test_dcb_cleanup (void)
{
static DcbExpected expected = { 0,
- { "dcbtool sc eth0 dcb off", NULL },
+ { "dcbtool sc eth0 dcb off",
+ "dcbtool sc eth0 app:fcoe e:0",
+ "dcbtool sc eth0 app:iscsi e:0",
+ "dcbtool sc eth0 app:fip e:0",
+ "dcbtool sc eth0 pfc e:0",
+ "dcbtool sc eth0 pg e:0",
+ NULL },
};
GError *error = NULL;
gboolean success;