dcb: turn off all DCB features when disabling DCB

Don't just disable DCB, but turn off the features too.
This commit is contained in:
Dan Williams 2014-03-20 12:39:44 -05:00
parent 32670b5264
commit ebc06a0015
2 changed files with 27 additions and 3 deletions

View file

@ -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

View file

@ -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;