From f9e983a7e70d3f6ddba0b0e3f2acbbfbf7ebec63 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Fri, 27 Jun 2014 00:28:46 +0000 Subject: OS-3142 a vnd mac_tx_notification somehow stuck around Reviewed by: Jerry Jelinek --- usr/src/uts/common/io/vnd/vnd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3