diff options
author | Michael Speer <Michael.Speer@Sun.COM> | 2009-05-26 19:21:24 -0700 |
---|---|---|
committer | Michael Speer <Michael.Speer@Sun.COM> | 2009-05-26 19:21:24 -0700 |
commit | 48056c53c7a3d65cab2626a67418401d97b58c1a (patch) | |
tree | 3168577b74b66af82a09d3b24d76d5c0ec6a2357 | |
parent | 5547f1d8c68fa119522b859bbf38315dc773e696 (diff) | |
download | illumos-joyent-48056c53c7a3d65cab2626a67418401d97b58c1a.tar.gz |
6757414 nxge has needless _accept_jumbo argument
6841289 memory leaks in nxge driver when running create and destroy HIO loop
6844074 nxge might still pass up packets while in polling mode
6840217 Bandwidth of PCI Express on x64 is limited because nxge sets MPS and MRRS to 128
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge.conf | 24 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_hio.c | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_hio_guest.c | 7 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_hw.c | 19 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_intr.c | 5 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_mac.c | 4 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_main.c | 87 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_ndd.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_rxdma.c | 82 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_send.c | 25 | ||||
-rw-r--r-- | usr/src/uts/common/io/nxge/nxge_txdma.c | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/nxge/nxge.h | 1 |
12 files changed, 72 insertions, 191 deletions
diff --git a/usr/src/uts/common/io/nxge/nxge.conf b/usr/src/uts/common/io/nxge/nxge.conf index 6c82d34177..baf6f24285 100644 --- a/usr/src/uts/common/io/nxge/nxge.conf +++ b/usr/src/uts/common/io/nxge/nxge.conf @@ -69,18 +69,6 @@ # default is 1 # adv_pause_cap = 1; # -# -#------- Jumbo frame support --------------------------------- -# To enable jumbo support for all nxge interfaces, -# accept_jumbo = 1; -# -# To disable jumbo support for all nxge interfaces, -# accept_jumbo = 0; -# -# Default is 0. See the example at the end of this file for -# enabling or disabling jumbo for a particular nxge interface. -# -# #------- Receive DMA Configuration ---------------------------- # # rxdma-intr-time @@ -157,18 +145,6 @@ # "/pci@7c0/pci@0/pci@8/network@0,2" 2 "nxge" # "/pci@7c0/pci@0/pci@8/network@0,3" 3 "nxge" # -# then you can enable jumbo for ports 0 and 1 and disable jumbo for ports 2 -# and 3 as follows, -# -# name = "pciex108e,abcd" parent = "/pci@7c0/pci@0/pci@8" unit-address = "0" -# accept_jumbo = 1; -# name = "pciex108e,abcd" parent = "/pci@7c0/pci@0/pci@8" unit-address = "0,1" -# accept_jumbo = 1; -# name = "pciex108e,abcd" parent = "/pci@7c0/pci@0/pci@8" unit-address = "0,2" -# accept_jumbo = 0; -# name = "pciex108e,abcd" parent = "/pci@7c0/pci@0/pci@8" unit-address = "0,3" -# accept_jumbo = 0; -# # Use the above path_to_inst file as an example to enable software LSO # for port 0 and 1, and disable software LSO for port 2 and 3. # diff --git a/usr/src/uts/common/io/nxge/nxge_hio.c b/usr/src/uts/common/io/nxge/nxge_hio.c index 32fdc67995..827553301c 100644 --- a/usr/src/uts/common/io/nxge/nxge_hio.c +++ b/usr/src/uts/common/io/nxge/nxge_hio.c @@ -2057,6 +2057,7 @@ nxge_hio_tdc_share( * Wait until this channel is idle. */ ring = nxge->tx_rings->rings[channel]; + ASSERT(ring != NULL); (void) atomic_swap_32(&ring->tx_ring_offline, NXGE_TX_RING_OFFLINING); if (ring->tx_ring_busy) { 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 5d433b7391..eb05298299 100644 --- a/usr/src/uts/common/io/nxge/nxge_hio_guest.c +++ b/usr/src/uts/common/io/nxge/nxge_hio_guest.c @@ -408,9 +408,16 @@ nxge_hio_vr_add(nxge_t *nxge) if ((*vio->__register)(mac_info, VIO_NET_RES_HYBRID, nxge->hio_mac_addr, mac_addr, &vr->vhp, &vio->cb)) { NXGE_DEBUG_MSG((nxge, HIO_CTL, "HIO registration() failed")); + KMEM_FREE(mac_info->m_src_addr, MAXMACADDRLEN); + KMEM_FREE(mac_info->m_dst_addr, MAXMACADDRLEN); + mac_free(mac_info); return (NXGE_ERROR); } + KMEM_FREE(mac_info->m_src_addr, MAXMACADDRLEN); + KMEM_FREE(mac_info->m_dst_addr, MAXMACADDRLEN); + mac_free(mac_info); + nxge->hio_vr = vr; /* For faster lookups. */ NXGE_DEBUG_MSG((nxge, HIO_CTL, "<== nxge_hio_vr_add")); diff --git a/usr/src/uts/common/io/nxge/nxge_hw.c b/usr/src/uts/common/io/nxge/nxge_hw.c index 5513ce4f4e..50b03766ee 100644 --- a/usr/src/uts/common/io/nxge/nxge_hw.c +++ b/usr/src/uts/common/io/nxge/nxge_hw.c @@ -18,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -52,7 +53,6 @@ static nxge_status_t nxge_check_xaui_xfp(p_nxge_t nxgep); extern uint32_t nxge_rx_mode; extern uint32_t nxge_jumbo_mtu; -extern boolean_t nxge_jumbo_enable; static void nxge_rtrace_ioctl(p_nxge_t, queue_t *, mblk_t *, struct iocblk *); @@ -97,24 +97,21 @@ void nxge_hw_id_init(p_nxge_t nxgep) { NXGE_DEBUG_MSG((nxgep, DDI_CTL, "==> nxge_hw_id_init")); + /* * Set up initial hardware parameters required such as mac mtu size. */ nxgep->mac.is_jumbo = B_FALSE; + /* * Set the maxframe size to 1522 (1518 + 4) to account for * VLAN tagged packets. */ - nxgep->mac.minframesize = NXGE_MIN_MAC_FRAMESIZE; /* 64 */ - nxgep->mac.maxframesize = NXGE_MAX_MAC_FRAMESIZE; /* 1522 */ - if (nxgep->param_arr[param_accept_jumbo].value || nxge_jumbo_enable) { - nxgep->mac.maxframesize = (uint16_t)nxge_jumbo_mtu; - nxgep->mac.is_jumbo = B_TRUE; - } - NXGE_DEBUG_MSG((nxgep, DDI_CTL, - "==> nxge_hw_id_init: maxframesize %d", - nxgep->mac.maxframesize)); + nxgep->mac.minframesize = NXGE_MIN_MAC_FRAMESIZE; /* 64 */ + nxgep->mac.maxframesize = NXGE_MAX_MAC_FRAMESIZE; /* 1522 */ + NXGE_DEBUG_MSG((nxgep, DDI_CTL, "<== nxge_hw_id_init: maxframesize %d", + nxgep->mac.maxframesize)); NXGE_DEBUG_MSG((nxgep, DDI_CTL, "<== nxge_hw_id_init")); } diff --git a/usr/src/uts/common/io/nxge/nxge_intr.c b/usr/src/uts/common/io/nxge/nxge_intr.c index 9c50981c34..0e6f85a0b6 100644 --- a/usr/src/uts/common/io/nxge/nxge_intr.c +++ b/usr/src/uts/common/io/nxge/nxge_intr.c @@ -730,6 +730,8 @@ nxge_hio_intr_uninit( } interrupts->intr_registered = B_FALSE; + KMEM_FREE(interrupts->htable, interrupts->intr_size); + interrupts->htable = NULL; if (nxge->ldgvp == NULL) goto nxge_hio_intr_uninit_exit; @@ -747,6 +749,9 @@ nxge_hio_intr_uninit( control->ldvp = 0; } + KMEM_FREE(control, sizeof (nxge_ldgv_t)); + nxge->ldgvp = NULL; + 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_mac.c b/usr/src/uts/common/io/nxge/nxge_mac.c index cbdd3f8481..9d8ef7bc5c 100644 --- a/usr/src/uts/common/io/nxge/nxge_mac.c +++ b/usr/src/uts/common/io/nxge/nxge_mac.c @@ -43,10 +43,8 @@ extern uint32_t nxge_no_link_notify; extern boolean_t nxge_no_msg; extern uint32_t nxge_lb_dbg; -extern boolean_t nxge_jumbo_enable; extern uint32_t nxge_jumbo_mtu; - typedef enum { CHECK_LINK_RESCHEDULE, CHECK_LINK_STOP @@ -5038,7 +5036,7 @@ phy_check_done: } } } else if (link_up) { /* XAUI linkup, no PHY */ - /* + /* * This is the back-to-back XAUI * connect case for Opus NEM. */ diff --git a/usr/src/uts/common/io/nxge/nxge_main.c b/usr/src/uts/common/io/nxge/nxge_main.c index 7ea86635e6..0d70432f4d 100644 --- a/usr/src/uts/common/io/nxge/nxge_main.c +++ b/usr/src/uts/common/io/nxge/nxge_main.c @@ -18,6 +18,7 @@ * * CDDL HEADER END */ + /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. @@ -102,7 +103,6 @@ uint32_t nxge_bcopy_thresh = TX_BCOPY_MAX; uint32_t nxge_dvma_thresh = TX_FASTDVMA_MIN; uint32_t nxge_dma_stream_thresh = TX_STREAM_MIN; uint32_t nxge_jumbo_mtu = TX_JUMBO_MTU; -boolean_t nxge_jumbo_enable = B_FALSE; nxge_tx_mode_t nxge_tx_scheme = NXGE_USE_SERIAL; /* MAX LSO size */ @@ -309,7 +309,6 @@ mac_priv_prop_t nxge_priv_props[] = { {"_fw_version", MAC_PROP_PERM_READ}, {"_port_mode", MAC_PROP_PERM_READ}, {"_hot_swap_phy", MAC_PROP_PERM_READ}, - {"_accept_jumbo", MAC_PROP_PERM_RW}, {"_rxdma_intr_time", MAC_PROP_PERM_RW}, {"_rxdma_intr_pkts", MAC_PROP_PERM_RW}, {"_class_opt_ipv4_tcp", MAC_PROP_PERM_RW}, @@ -529,7 +528,6 @@ nxge_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) int status = DDI_SUCCESS; uint8_t portn; nxge_mmac_t *mmac_info; - p_nxge_param_t param_arr; NXGE_DEBUG_MSG((nxgep, DDI_CTL, "==> nxge_attach")); @@ -733,6 +731,11 @@ nxge_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) ddi_prop_free(regp); } + /* + * Set the defaults for the MTU size. + */ + nxge_hw_id_init(nxgep); + if (isLDOMguest(nxgep)) { uchar_t *prop_val; uint_t prop_len; @@ -775,9 +778,6 @@ nxge_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) "max-frame-size", NXGE_MTU_DEFAULT_MAX); if ((max_frame_size > NXGE_MTU_DEFAULT_MAX) && (max_frame_size <= TX_JUMBO_MTU)) { - param_arr = nxgep->param_arr; - - param_arr[param_accept_jumbo].value = 1; nxgep->mac.is_jumbo = B_TRUE; nxgep->mac.maxframesize = (uint16_t)max_frame_size; nxgep->mac.default_mtu = nxgep->mac.maxframesize - @@ -816,7 +816,6 @@ nxge_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) goto nxge_attach_fail; } - nxge_hw_id_init(nxgep); if (!isLDOMguest(nxgep)) nxge_hw_init_niu_common(nxgep); @@ -1216,8 +1215,9 @@ nxge_map_regs(p_nxge_t nxgep) #if !defined(_BIG_ENDIAN) /* workarounds for x86 systems */ pci_offset = 0x80 + PCIE_DEVCTL; - pcie_devctl = 0x0; - pcie_devctl &= PCIE_DEVCTL_ENABLE_NO_SNOOP; + pcie_devctl = pci_config_get16(dev_regs->nxge_pciregh, + pci_offset); + pcie_devctl &= ~PCIE_DEVCTL_ENABLE_NO_SNOOP; pcie_devctl |= PCIE_DEVCTL_RO_EN; pci_config_put16(dev_regs->nxge_pciregh, pci_offset, pcie_devctl); @@ -4515,18 +4515,14 @@ nxge_m_setprop(void *barg, const char *pr_name, mac_prop_id_t pr_num, err = 0; break; } + if (nxgep->nxge_mac_state == NXGE_MAC_STARTED) { err = EBUSY; break; } - if (new_mtu < NXGE_DEFAULT_MTU || - new_mtu > NXGE_MAXIMUM_MTU) { - err = EINVAL; - break; - } - if ((new_mtu > NXGE_DEFAULT_MTU) && - !nxgep->mac.is_jumbo) { + if ((new_mtu < NXGE_DEFAULT_MTU) || + (new_mtu > NXGE_MAXIMUM_MTU)) { err = EINVAL; break; } @@ -4550,6 +4546,11 @@ nxge_m_setprop(void *barg, const char *pr_name, mac_prop_id_t pr_num, } nxgep->mac.default_mtu = new_mtu; + if (new_mtu > NXGE_DEFAULT_MTU) + nxgep->mac.is_jumbo = B_TRUE; + else + nxgep->mac.is_jumbo = B_FALSE; + NXGE_DEBUG_MSG((nxgep, NXGE_CTL, "==> nxge_m_setprop: set MTU: %d maxframe %d", new_mtu, nxgep->mac.maxframesize)); @@ -4756,42 +4757,6 @@ nxge_set_priv_prop(p_nxge_t nxgep, const char *pr_name, uint_t pr_valsize, NXGE_DEBUG_MSG((nxgep, NXGE_CTL, "==> nxge_set_priv_prop: name %s", pr_name)); - if (strcmp(pr_name, "_accept_jumbo") == 0) { - (void) ddi_strtol(pr_val, (char **)NULL, 0, &result); - NXGE_DEBUG_MSG((nxgep, NXGE_CTL, - "<== nxge_set_priv_prop: name %s " - "pr_val %s result %d " - "param %d is_jumbo %d", - pr_name, pr_val, result, - param_arr[param_accept_jumbo].value, - nxgep->mac.is_jumbo)); - - if (result > 1 || result < 0) { - err = EINVAL; - } else { - if (nxgep->mac.is_jumbo == - (uint32_t)result) { - NXGE_DEBUG_MSG((nxgep, NXGE_CTL, - "no change (%d %d)", - nxgep->mac.is_jumbo, - result)); - return (0); - } - } - - param_arr[param_accept_jumbo].value = result; - nxgep->mac.is_jumbo = B_FALSE; - if (result) { - nxgep->mac.is_jumbo = B_TRUE; - } - - NXGE_DEBUG_MSG((nxgep, NXGE_CTL, - "<== nxge_set_priv_prop: name %s (value %d) is_jumbo %d", - pr_name, result, nxgep->mac.is_jumbo)); - - return (err); - } - /* Blanking */ if (strcmp(pr_name, "_rxdma_intr_time") == 0) { err = nxge_param_rx_intr_time(nxgep, NULL, NULL, @@ -5166,24 +5131,6 @@ nxge_get_priv_prop(p_nxge_t nxgep, const char *pr_name, uint_t pr_flags, } - /* accept jumbo */ - if (strcmp(pr_name, "_accept_jumbo") == 0) { - if (is_default) - (void) snprintf(valstr, sizeof (valstr), "%d", 0); - else - (void) snprintf(valstr, sizeof (valstr), - "%d", nxgep->mac.is_jumbo); - err = 0; - NXGE_DEBUG_MSG((nxgep, NXGE_CTL, - "==> nxge_get_priv_prop: name %s (value %d (%d, %d))", - pr_name, - (uint32_t)param_arr[param_accept_jumbo].value, - nxgep->mac.is_jumbo, - nxge_jumbo_enable)); - - goto done; - } - /* Receive Interrupt Blanking Parameters */ if (strcmp(pr_name, "_rxdma_intr_time") == 0) { err = 0; diff --git a/usr/src/uts/common/io/nxge/nxge_ndd.c b/usr/src/uts/common/io/nxge/nxge_ndd.c index 2fe67c81f6..307f553391 100644 --- a/usr/src/uts/common/io/nxge/nxge_ndd.c +++ b/usr/src/uts/common/io/nxge/nxge_ndd.c @@ -248,9 +248,6 @@ static nxge_param_t nxge_param_arr[] = { { nxge_param_get_mac, nxge_param_set_mac, NXGE_PARAM_DONT_SHOW, 0, 255, 4, 4, "ipg2", "ipg2"}, - { nxge_param_get_mac, nxge_param_set_mac, NXGE_PARAM_MAC_RW, - 0, 1, 0, 0, "accept-jumbo", "accept_jumbo"}, - /* Transmit DMA channels */ { nxge_param_get_generic, NULL, NXGE_PARAM_READ | NXGE_PARAM_READ_PROP | NXGE_PARAM_DONT_SHOW, diff --git a/usr/src/uts/common/io/nxge/nxge_rxdma.c b/usr/src/uts/common/io/nxge/nxge_rxdma.c index 1432a4a544..1fc9da46a7 100644 --- a/usr/src/uts/common/io/nxge/nxge_rxdma.c +++ b/usr/src/uts/common/io/nxge/nxge_rxdma.c @@ -53,7 +53,6 @@ extern uint32_t nxge_mblks_pending; * ISR doing Rx Processing. */ extern uint32_t nxge_max_rx_pkts; -boolean_t nxge_jumbo_enable; /* * Tunables to manage the receive buffer blocks. @@ -115,7 +114,6 @@ nxge_status_t nxge_disable_rxdma_channel(p_nxge_t, uint16_t); static p_rx_msg_t nxge_allocb(size_t, uint32_t, p_nxge_dma_common_t); static void nxge_freeb(p_rx_msg_t); -static mblk_t *nxge_rx_pkts_vring(p_nxge_t, uint_t, rx_dma_ctl_stat_t); static nxge_status_t nxge_rx_err_evnts(p_nxge_t, int, rx_dma_ctl_stat_t); static nxge_status_t nxge_rxdma_handle_port_errors(p_nxge_t, @@ -1829,7 +1827,7 @@ nxge_rx_intr(void *arg1, void *arg2) npi_handle_t handle; rx_dma_ctl_stat_t cs; p_rx_rcr_ring_t rcr_ring; - mblk_t *mp; + mblk_t *mp = NULL; if (ldvp == NULL) { NXGE_DEBUG_MSG((NULL, INT_CTL, @@ -1928,7 +1926,9 @@ nxge_rx_intr(void *arg1, void *arg2) cs.bits.hdw.rcrto, cs.bits.hdw.rcrthres)); - mp = nxge_rx_pkts_vring(nxgep, ldvp->vdma_index, cs); + if (rcr_ring->poll_flag == 0) { + mp = nxge_rx_pkts(nxgep, rcr_ring, cs, -1); + } /* error events. */ if (cs.value & RX_DMA_CTL_STAT_ERROR) { @@ -1992,7 +1992,7 @@ nxge_rx_intr(void *arg1, void *arg2) } MUTEX_EXIT(&rcr_ring->lock); - if (mp) { + if (mp != NULL) { if (!isLDOMguest(nxgep)) mac_rx_ring(nxgep->mach, rcr_ring->rcr_mac_handle, mp, rcr_ring->rcr_gen_num); @@ -2014,76 +2014,6 @@ nxge_rx_intr(void *arg1, void *arg2) } /* - * Process the packets received in the specified logical device - * and pass up a chain of message blocks to the upper layer. - * The RCR ring lock must be held before calling this function. - */ -static mblk_t * -nxge_rx_pkts_vring(p_nxge_t nxgep, uint_t vindex, rx_dma_ctl_stat_t cs) -{ - p_mblk_t mp; - p_rx_rcr_ring_t rcrp; - - NXGE_DEBUG_MSG((nxgep, RX_CTL, "==> nxge_rx_pkts_vring")); - rcrp = nxgep->rx_rcr_rings->rcr_rings[vindex]; - - NXGE_DEBUG_MSG((nxgep, NXGE_ERR_CTL, - "==> nxge_rx_pkts_vring: (calling nxge_rx_pkts)rdc %d " - "rcr_mac_handle $%p ", rcrp->rdc, rcrp->rcr_mac_handle)); - if ((mp = nxge_rx_pkts(nxgep, rcrp, cs, -1)) == NULL) { - NXGE_DEBUG_MSG((nxgep, RX_CTL, - "<== nxge_rx_pkts_vring: no mp")); - return (NULL); - } - - NXGE_DEBUG_MSG((nxgep, RX_CTL, "==> nxge_rx_pkts_vring: $%p", - mp)); - -#ifdef NXGE_DEBUG - NXGE_DEBUG_MSG((nxgep, RX_CTL, - "==> nxge_rx_pkts_vring:calling mac_rx " - "LEN %d mp $%p mp->b_cont $%p mp->b_next $%p rcrp $%p " - "mac_handle $%p", - mp->b_wptr - mp->b_rptr, - mp, mp->b_cont, mp->b_next, - rcrp, rcrp->rcr_mac_handle)); - - NXGE_DEBUG_MSG((nxgep, RX_CTL, - "==> nxge_rx_pkts_vring: dump packets " - "(mp $%p b_rptr $%p b_wptr $%p):\n %s", - mp, - mp->b_rptr, - mp->b_wptr, - nxge_dump_packet((char *)mp->b_rptr, - mp->b_wptr - mp->b_rptr))); - if (mp->b_cont) { - NXGE_DEBUG_MSG((nxgep, RX_CTL, - "==> nxge_rx_pkts_vring: dump b_cont packets " - "(mp->b_cont $%p b_rptr $%p b_wptr $%p):\n %s", - mp->b_cont, - mp->b_cont->b_rptr, - mp->b_cont->b_wptr, - nxge_dump_packet((char *)mp->b_cont->b_rptr, - mp->b_cont->b_wptr - mp->b_cont->b_rptr))); - } - if (mp->b_next) { - NXGE_DEBUG_MSG((nxgep, RX_CTL, - "==> nxge_rx_pkts_vring: dump next packets " - "(b_rptr $%p): %s", - mp->b_next->b_rptr, - nxge_dump_packet((char *)mp->b_next->b_rptr, - mp->b_next->b_wptr - mp->b_next->b_rptr))); - } -#endif - NXGE_DEBUG_MSG((nxgep, NXGE_ERR_CTL, - "<== nxge_rx_pkts_vring: returning rdc %d rcr_mac_handle $%p ", - rcrp->rdc, rcrp->rcr_mac_handle)); - - return (mp); -} - - -/* * This routine is the main packet receive processing function. * It gets the packet type, error code, and buffer related * information from the receive completion entry. @@ -3902,7 +3832,7 @@ nxge_map_rxdma_channel_buf_ring(p_nxge_t nxgep, uint16_t channel, rbrp->block_size = nxgep->rx_default_block_size; - if (!nxge_jumbo_enable && !nxgep->param_arr[param_accept_jumbo].value) { + if (!nxgep->mac.is_jumbo) { rbrp->pkt_buf_size2 = RBR_BUFSZ2_2K; rbrp->pkt_buf_size2_bytes = RBR_BUFSZ2_2K_BYTES; rbrp->npi_pkt_buf_size2 = SIZE_2KB; diff --git a/usr/src/uts/common/io/nxge/nxge_send.c b/usr/src/uts/common/io/nxge/nxge_send.c index c693511dd9..eff03030ff 100644 --- a/usr/src/uts/common/io/nxge/nxge_send.c +++ b/usr/src/uts/common/io/nxge/nxge_send.c @@ -105,14 +105,33 @@ nxge_tx_ring_send(void *arg, mblk_t *mp) channel = nxgep->pt_config.hw_config.tdc.start + nrhp->index; tx_ring_p = nxgep->tx_rings->rings[channel]; + /* + * We may be in a transition from offlined DMA to onlined + * DMA. + */ + if (tx_ring_p == NULL) { + ASSERT(tx_ring_p != NULL); + freemsg(mp); + return ((mblk_t *)NULL); + } + + /* + * Valid DMA? + */ ASSERT(nxgep == tx_ring_p->nxgep); -#ifdef DEBUG - if (isLDOMservice(nxgep)) { + /* + * Make sure DMA is not offlined. + */ + if (isLDOMservice(nxgep) && tx_ring_p->tx_ring_offline) { ASSERT(!tx_ring_p->tx_ring_offline); + freemsg(mp); + return ((mblk_t *)NULL); } -#endif + /* + * Transmit the packet. + */ status = nxge_start(nxgep, tx_ring_p, mp); if (status) { nxge_tx_ring_dispatch(tx_ring_p); diff --git a/usr/src/uts/common/io/nxge/nxge_txdma.c b/usr/src/uts/common/io/nxge/nxge_txdma.c index 7a4de7d244..b995aeb641 100644 --- a/usr/src/uts/common/io/nxge/nxge_txdma.c +++ b/usr/src/uts/common/io/nxge/nxge_txdma.c @@ -2349,6 +2349,11 @@ nxge_unmap_txdma_channel(p_nxge_t nxgep, uint16_t channel) nxge_free_txb(nxgep, channel); + /* + * Cleanup the reference to the ring now that it does not exist. + */ + nxgep->tx_rings->rings[channel] = NULL; + NXGE_DEBUG_MSG((nxgep, MEM3_CTL, "<== nxge_unmap_txdma_channel")); } diff --git a/usr/src/uts/common/sys/nxge/nxge.h b/usr/src/uts/common/sys/nxge/nxge.h index 660288bce2..800418f9db 100644 --- a/usr/src/uts/common/sys/nxge/nxge.h +++ b/usr/src/uts/common/sys/nxge/nxge.h @@ -125,7 +125,6 @@ typedef enum { param_ipg0, param_ipg1, param_ipg2, - param_accept_jumbo, param_txdma_weight, param_txdma_channels_begin, |