summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2014-06-27 00:28:46 +0000
committerRobert Mustacchi <rm@joyent.com>2014-06-27 16:22:16 +0000
commitf9e983a7e70d3f6ddba0b0e3f2acbbfbf7ebec63 (patch)
tree623ea197fef3f56d705a8768239ea2fe2316e46e
parentdfb423e13dce7c91059cc1b29429e326d6737ba3 (diff)
downloadillumos-joyent-f9e983a7e70d3f6ddba0b0e3f2acbbfbf7ebec63.tar.gz
OS-3142 a vnd mac_tx_notification somehow stuck around
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
-rw-r--r--usr/src/uts/common/io/vnd/vnd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr/src/uts/common/io/vnd/vnd.c b/usr/src/uts/common/io/vnd/vnd.c
index 9c86c85a4c..4594a1854e 100644
--- a/usr/src/uts/common/io/vnd/vnd.c
+++ b/usr/src/uts/common/io/vnd/vnd.c
@@ -2220,6 +2220,18 @@ vnd_dld_cap_enable(vnd_str_t *vsp, vnd_rx_t rxfunc)
vnd_mac_enter(vsp, &mph);
+ /*
+ * If we're coming in here for a second pass, we need to make sure that
+ * we remove an existing flow control notification callback, otherwise
+ * we'll create a duplicate that will remain with garbage data.
+ */
+ if (c->vsc_tx_fc_hdl != NULL) {
+ ASSERT(c->vsc_set_fcb_hdl != NULL);
+ (void) c->vsc_set_fcb_f(c->vsc_set_fcb_hdl, NULL,
+ c->vsc_tx_fc_hdl);
+ c->vsc_tx_fc_hdl = NULL;
+ }
+
if (vsp->vns_caps.vsc_capab_f(c->vsc_capab_hdl,
DLD_CAPAB_DIRECT, &d, DLD_ENABLE) == 0) {
c->vsc_tx_f = (vnd_dld_tx_t)d.di_tx_df;
@@ -2376,7 +2388,7 @@ vnd_st_shutdown(vnd_str_t *vsp)
if (vsc->vsc_flags & VNS_C_DIRECT) {
vnd_mac_enter(vsp, &mph);
vsc->vsc_flags &= ~VNS_C_DIRECT;
- vsc->vsc_set_fcb_f(vsc->vsc_set_fcb_hdl, NULL,
+ (void) vsc->vsc_set_fcb_f(vsc->vsc_set_fcb_hdl, NULL,
vsc->vsc_tx_fc_hdl);
vsc->vsc_tx_fc_hdl = NULL;
(void) vsc->vsc_capab_f(vsc->vsc_capab_hdl, DLD_CAPAB_DIRECT,