diff options
author | Michael Speer <Michael.Speer@Sun.COM> | 2008-09-13 23:17:18 -0700 |
---|---|---|
committer | Michael Speer <Michael.Speer@Sun.COM> | 2008-09-13 23:17:18 -0700 |
commit | 9d5b8bc52bffb83a81625224a3b60481b39a6ba9 (patch) | |
tree | 1013bed26b3308b3507488275258200131c7bcd5 | |
parent | 94ca8f4c13fb87d6076080b70b0b75b529a3f943 (diff) | |
download | illumos-joyent-9d5b8bc52bffb83a81625224a3b60481b39a6ba9.tar.gz |
6746573 Failure to register with HV can panic hybrid mode nxge
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_hio.c | 19 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_hio_guest.c | 10 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_intr.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_main.c | 17 |
4 files changed, 28 insertions, 24 deletions
diff --git a/usr/src/uts/common/io/nxge/nxge_hio.c b/usr/src/uts/common/io/nxge/nxge_hio.c index 8b93c3191c..8a07674981 100644 --- a/usr/src/uts/common/io/nxge/nxge_hio.c +++ b/usr/src/uts/common/io/nxge/nxge_hio.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * nxge_hio.c * @@ -128,8 +126,7 @@ nxge_get_environs( * Any domain */ int -nxge_hio_init( - nxge_t *nxge) +nxge_hio_init(nxge_t *nxge) { nxge_hio_data_t *nhd; @@ -148,19 +145,17 @@ nxge_hio_init( #endif void -nxge_hio_uninit( - nxge_t *nxge) +nxge_hio_uninit(nxge_t *nxge) { nxge_hio_data_t *nhd = (nxge_hio_data_t *)nxge->nxge_hw_p->hio; - ASSERT(nhd != NULL); ASSERT(nxge->nxge_hw_p->ndevs == 0); - MUTEX_DESTROY(&nhd->lock); - - KMEM_FREE(nhd, sizeof (*nhd)); - - nxge->nxge_hw_p->hio = 0; + if (nhd != NULL) { + MUTEX_DESTROY(&nhd->lock); + KMEM_FREE(nhd, sizeof (*nhd)); + nxge->nxge_hw_p->hio = 0; + } } /* diff --git a/usr/src/uts/common/io/nxge/nxge_hio_guest.c b/usr/src/uts/common/io/nxge/nxge_hio_guest.c index 84b1c8d930..00587c600b 100644 --- a/usr/src/uts/common/io/nxge/nxge_hio_guest.c +++ b/usr/src/uts/common/io/nxge/nxge_hio_guest.c @@ -587,9 +587,13 @@ nxge_hio_vr_release( */ nxge_uninit_txdma_channels(nxge); - // Remove both groups. Assumption: only two groups! - nxge_grp_remove(nxge, (vr_handle_t)nxge->rx_set.group[0]); - nxge_grp_remove(nxge, (vr_handle_t)nxge->tx_set.group[0]); + /* + * Remove both groups. Assumption: only two groups! + */ + if (nxge->rx_set.group[0] != NULL) + nxge_grp_remove(nxge, (vr_handle_t)nxge->rx_set.group[0]); + if (nxge->tx_set.group[0] != NULL) + nxge_grp_remove(nxge, (vr_handle_t)nxge->tx_set.group[0]); NXGE_DEBUG_MSG((nxge, MEM2_CTL, "<== nxge_hio_vr_release")); diff --git a/usr/src/uts/common/io/nxge/nxge_intr.c b/usr/src/uts/common/io/nxge/nxge_intr.c index e10c5b8653..adc440f596 100644 --- a/usr/src/uts/common/io/nxge/nxge_intr.c +++ b/usr/src/uts/common/io/nxge/nxge_intr.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * nxge_intr.c * @@ -727,6 +725,9 @@ nxge_hio_intr_uninit( interrupts->intr_registered = B_FALSE; + if (nxge->ldgvp == NULL) + goto nxge_hio_intr_uninit_exit; + control = nxge->ldgvp; if (control->ldgp) { KMEM_FREE(control->ldgp, @@ -740,6 +741,7 @@ nxge_hio_intr_uninit( control->ldvp = 0; } +nxge_hio_intr_uninit_exit: NXGE_DEBUG_MSG((nxge, HIO_CTL, "<== nxge_hio_intr_uninit")); } diff --git a/usr/src/uts/common/io/nxge/nxge_main.c b/usr/src/uts/common/io/nxge/nxge_main.c index a2197ca804..cded642776 100644 --- a/usr/src/uts/common/io/nxge/nxge_main.c +++ b/usr/src/uts/common/io/nxge/nxge_main.c @@ -633,7 +633,7 @@ nxge_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) #if defined(sun4v) /* This is required by nxge_hio_init(), which follows. */ if ((status = nxge_hsvc_register(nxgep)) != DDI_SUCCESS) - goto nxge_attach_fail; + goto nxge_attach_fail4; #endif if ((status = nxge_hio_init(nxgep)) != NXGE_OK) { @@ -1082,8 +1082,7 @@ nxge_unattach(p_nxge_t nxgep) #if defined(sun4v) int -nxge_hsvc_register( - nxge_t *nxgep) +nxge_hsvc_register(nxge_t *nxgep) { nxge_status_t status; @@ -6579,10 +6578,14 @@ nxge_uninit_common_dev(p_nxge_t nxgep) * assigned to this instance of nxge in * nxge_use_cfg_dma_config(). */ - p_dma_cfgp = (p_nxge_dma_pt_cfg_t)&nxgep->pt_config; - p_cfgp = (p_nxge_hw_pt_cfg_t)&p_dma_cfgp->hw_config; - (void) nxge_fzc_rdc_tbl_unbind(nxgep, - p_cfgp->def_mac_rxdma_grpid); + if (!isLDOMguest(nxgep)) { + p_dma_cfgp = + (p_nxge_dma_pt_cfg_t)&nxgep->pt_config; + p_cfgp = + (p_nxge_hw_pt_cfg_t)&p_dma_cfgp->hw_config; + (void) nxge_fzc_rdc_tbl_unbind(nxgep, + p_cfgp->def_mac_rxdma_grpid); + } if (hw_p->ndevs) { hw_p->ndevs--; |