diff options
author | Dan Williams <dcbw@redhat.com> | 2014-03-27 13:49:50 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-04-02 09:37:15 -0500 |
commit | 18fd3e45d8db3428d4840d7cb9ea1980a22ef7de (patch) | |
tree | 3e57c6d21c5487c5f68dd3befd8e54f67fa66eab /src/nm-dcb.h | |
parent | 0b664ad4a4dc0e8acefdf53f8a9adb12bbd0cd29 (diff) |
dcb: separate DCB enable/disable and wait for carrier changes (rh #799241) (rh #1081991)
Non-git-master versions of lldpad refuse to touch a device that doesn't
have a carrier. And when enabling/disabling DCB, the kernel driver will
reconfigure itself and may turn carrier off for a few seconds. So we
must ensure that before enabling/disabling DCB, the carrier is already
on. Next we must ensure that *after* enabling/disabling DCB, the
carrier is back on before doing further DCB setup.
There's a race condition between enabling/disabling DCB and receiving
the carrier event in NetworkManager that has to be handled carefully.
Because the carrier may not yet be down after the dcbtool call to
enable/disable DCB returns, we need to wait for a couple seconds for
the carrier to go down, and then again for it to come back up.
Otherwise we might see the still-on carrier, proceed with DCB setup,
and the carrier finally goes down halfway through the setup, which
will fail the operations with "DCB not enabled, link down, or DCB
not supported" errors from lldpad.
Diffstat (limited to 'src/nm-dcb.h')
-rw-r--r-- | src/nm-dcb.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nm-dcb.h b/src/nm-dcb.h index 3dbd5e6f4..bfe5cedff 100644 --- a/src/nm-dcb.h +++ b/src/nm-dcb.h @@ -48,6 +48,7 @@ GQuark nm_dcb_error_quark (void); GType nm_dcb_error_get_type (void); +gboolean nm_dcb_enable (const char *iface, gboolean enable, GError **error); gboolean nm_dcb_setup (const char *iface, NMSettingDcb *s_dcb, GError **error); gboolean nm_dcb_cleanup (const char *iface, GError **error); @@ -68,6 +69,12 @@ gboolean do_helper (const char *iface, const char *fmt, ...) G_GNUC_PRINTF(6, 7); +gboolean _dcb_enable (const char *iface, + gboolean enable, + DcbFunc run_func, + gpointer user_data, + GError **error); + gboolean _dcb_setup (const char *iface, NMSettingDcb *s_dcb, DcbFunc run_func, |