Lines Matching full:ss

1176 	struct mxge_slice_state *ss;  in mxge_reset()  local
1236 rx_done = &sc->ss[slice].rx_done; in mxge_reset()
1269 ss = &sc->ss[slice]; in mxge_reset()
1271 ss->irq_claim = irq_claim + (2 * slice); in mxge_reset()
1273 ss->rx_done.idx = 0; in mxge_reset()
1274 ss->rx_done.cnt = 0; in mxge_reset()
1275 ss->tx.req = 0; in mxge_reset()
1276 ss->tx.done = 0; in mxge_reset()
1277 ss->tx.pkt_done = 0; in mxge_reset()
1278 ss->tx.queue_active = 0; in mxge_reset()
1279 ss->tx.activate = 0; in mxge_reset()
1280 ss->tx.deactivate = 0; in mxge_reset()
1281 ss->tx.wake = 0; in mxge_reset()
1282 ss->tx.defrag = 0; in mxge_reset()
1283 ss->tx.stall = 0; in mxge_reset()
1284 ss->rx_big.cnt = 0; in mxge_reset()
1285 ss->rx_small.cnt = 0; in mxge_reset()
1286 ss->lc.lro_bad_csum = 0; in mxge_reset()
1287 ss->lc.lro_queued = 0; in mxge_reset()
1288 ss->lc.lro_flushed = 0; in mxge_reset()
1289 if (ss->fw_stats != NULL) { in mxge_reset()
1290 bzero(ss->fw_stats, sizeof *ss->fw_stats); in mxge_reset()
1405 struct mxge_slice_state *ss; in mxge_rem_sysctls() local
1412 ss = &sc->ss[slice]; in mxge_rem_sysctls()
1413 if (ss == NULL || ss->sysctl_tree == NULL) in mxge_rem_sysctls()
1415 sysctl_ctx_free(&ss->sysctl_ctx); in mxge_rem_sysctls()
1416 ss->sysctl_tree = NULL; in mxge_rem_sysctls()
1428 struct mxge_slice_state *ss; in mxge_add_sysctls() local
1434 fw = sc->ss[0].fw_stats; in mxge_add_sysctls()
1571 ss = &sc->ss[slice]; in mxge_add_sysctls()
1572 sysctl_ctx_init(&ss->sysctl_ctx); in mxge_add_sysctls()
1573 ctx = &ss->sysctl_ctx; in mxge_add_sysctls()
1576 ss->sysctl_tree = in mxge_add_sysctls()
1579 children = SYSCTL_CHILDREN(ss->sysctl_tree); in mxge_add_sysctls()
1582 CTLFLAG_RD, &ss->rx_small.cnt, in mxge_add_sysctls()
1586 CTLFLAG_RD, &ss->rx_big.cnt, in mxge_add_sysctls()
1589 "lro_flushed", CTLFLAG_RD, &ss->lc.lro_flushed, in mxge_add_sysctls()
1593 "lro_bad_csum", CTLFLAG_RD, &ss->lc.lro_bad_csum, in mxge_add_sysctls()
1597 "lro_queued", CTLFLAG_RD, &ss->lc.lro_queued, in mxge_add_sysctls()
1603 CTLFLAG_RD, &ss->tx.req, in mxge_add_sysctls()
1608 CTLFLAG_RD, &ss->tx.done, in mxge_add_sysctls()
1612 CTLFLAG_RD, &ss->tx.pkt_done, in mxge_add_sysctls()
1616 CTLFLAG_RD, &ss->tx.stall, in mxge_add_sysctls()
1620 CTLFLAG_RD, &ss->tx.wake, in mxge_add_sysctls()
1624 CTLFLAG_RD, &ss->tx.defrag, in mxge_add_sysctls()
1628 CTLFLAG_RD, &ss->tx.queue_active, in mxge_add_sysctls()
1632 CTLFLAG_RD, &ss->tx.activate, in mxge_add_sysctls()
1636 CTLFLAG_RD, &ss->tx.deactivate, in mxge_add_sysctls()
1716 mxge_parse_tx(struct mxge_slice_state *ss, struct mbuf *m, in mxge_parse_tx() argument
1745 ss->scratch); in mxge_parse_tx()
1746 pi->ip = (struct ip *)(ss->scratch + pi->ip_off); in mxge_parse_tx()
1755 sizeof(struct tcphdr), ss->scratch); in mxge_parse_tx()
1756 pi->ip = (struct ip *)(ss->scratch + pi->ip_off); in mxge_parse_tx()
1765 ss->scratch); in mxge_parse_tx()
1766 pi->ip6 = (struct ip6_hdr *)(ss->scratch + pi->ip_off); in mxge_parse_tx()
1777 if (pi->ip_off + pi->ip_hlen > ss->sc->max_tso6_hlen) in mxge_parse_tx()
1783 sizeof(struct tcphdr), ss->scratch); in mxge_parse_tx()
1784 pi->ip6 = (struct ip6_hdr *)(ss->scratch + pi->ip_off); in mxge_parse_tx()
1798 mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m, in mxge_encap_tso() argument
1863 tx = &ss->tx; in mxge_encap_tso()
1956 if ((ss->sc->num_slices > 1) && tx->queue_active == 0) { in mxge_encap_tso()
1969 ss->oerrors++; in mxge_encap_tso()
2017 mxge_encap(struct mxge_slice_state *ss, struct mbuf *m) in mxge_encap() argument
2029 sc = ss->sc; in mxge_encap()
2030 tx = &ss->tx; in mxge_encap()
2041 if (mxge_parse_tx(ss, m, &pi)) in mxge_encap()
2057 ss->tx.defrag++; in mxge_encap()
2076 mxge_encap_tso(ss, m, cnt, &pi); in mxge_encap()
2162 if ((ss->sc->num_slices > 1) && tx->queue_active == 0) { in mxge_encap()
2175 ss->oerrors++; in mxge_encap()
2188 tx = &sc->ss[slice].tx; in mxge_qflush()
2198 mxge_start_locked(struct mxge_slice_state *ss) in mxge_start_locked() argument
2205 sc = ss->sc; in mxge_start_locked()
2207 tx = &ss->tx; in mxge_start_locked()
2218 mxge_encap(ss, m); in mxge_start_locked()
2221 if (((ss->if_drv_flags & IFF_DRV_OACTIVE) == 0) in mxge_start_locked()
2223 ss->if_drv_flags |= IFF_DRV_OACTIVE; in mxge_start_locked()
2229 mxge_transmit_locked(struct mxge_slice_state *ss, struct mbuf *m) in mxge_transmit_locked() argument
2236 sc = ss->sc; in mxge_transmit_locked()
2238 tx = &ss->tx; in mxge_transmit_locked()
2240 if ((ss->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != in mxge_transmit_locked()
2251 mxge_encap(ss, m); in mxge_transmit_locked()
2256 mxge_start_locked(ss); in mxge_transmit_locked()
2264 struct mxge_slice_state *ss; in mxge_transmit() local
2272 ss = &sc->ss[slice]; in mxge_transmit()
2273 tx = &ss->tx; in mxge_transmit()
2276 err = mxge_transmit_locked(ss, m); in mxge_transmit()
2289 struct mxge_slice_state *ss; in mxge_start() local
2292 ss = &sc->ss[0]; in mxge_start()
2293 mtx_lock(&ss->tx.mtx); in mxge_start()
2294 mxge_start_locked(ss); in mxge_start()
2295 mtx_unlock(&ss->tx.mtx); in mxge_start()
2323 mxge_get_buf_small(struct mxge_slice_state *ss, bus_dmamap_t map, int idx) in mxge_get_buf_small() argument
2327 mxge_rx_ring_t *rx = &ss->rx_small; in mxge_get_buf_small()
2356 mxge_get_buf_big(struct mxge_slice_state *ss, bus_dmamap_t map, int idx) in mxge_get_buf_big() argument
2360 mxge_rx_ring_t *rx = &ss->rx_big; in mxge_get_buf_big()
2553 mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len, in mxge_rx_done_big() argument
2564 sc = ss->sc; in mxge_rx_done_big()
2566 rx = &ss->rx_big; in mxge_rx_done_big()
2572 if (mxge_get_buf_big(ss, rx->extra_map, idx)) { in mxge_rx_done_big()
2593 ss->ipackets++; in mxge_rx_done_big()
2600 m->m_pkthdr.flowid = (ss - sc->ss); in mxge_rx_done_big()
2612 if (lro && (0 == tcp_lro_rx(&ss->lc, m, 0))) in mxge_rx_done_big()
2621 mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len, in mxge_rx_done_small() argument
2632 sc = ss->sc; in mxge_rx_done_small()
2634 rx = &ss->rx_small; in mxge_rx_done_small()
2640 if (mxge_get_buf_small(ss, rx->extra_map, idx)) { in mxge_rx_done_small()
2661 ss->ipackets++; in mxge_rx_done_small()
2668 m->m_pkthdr.flowid = (ss - sc->ss); in mxge_rx_done_small()
2680 if (lro && (0 == tcp_lro_rx(&ss->lc, m, csum))) in mxge_rx_done_small()
2689 mxge_clean_rx_done(struct mxge_slice_state *ss) in mxge_clean_rx_done() argument
2691 mxge_rx_done_t *rx_done = &ss->rx_done; in mxge_clean_rx_done()
2697 lro = if_getcapenable(ss->sc->ifp) & IFCAP_LRO; in mxge_clean_rx_done()
2703 mxge_rx_done_small(ss, length, checksum, lro); in mxge_clean_rx_done()
2705 mxge_rx_done_big(ss, length, checksum, lro); in mxge_clean_rx_done()
2714 tcp_lro_flush_all(&ss->lc); in mxge_clean_rx_done()
2719 mxge_tx_done(struct mxge_slice_state *ss, uint32_t mcp_idx) in mxge_tx_done() argument
2728 tx = &ss->tx; in mxge_tx_done()
2729 ifp = ss->sc->ifp; in mxge_tx_done()
2737 ss->obytes += m->m_pkthdr.len; in mxge_tx_done()
2739 ss->omcasts++; in mxge_tx_done()
2740 ss->opackets++; in mxge_tx_done()
2754 flags = &ss->if_drv_flags; in mxge_tx_done()
2755 mtx_lock(&ss->tx.mtx); in mxge_tx_done()
2759 ss->tx.wake++; in mxge_tx_done()
2760 mxge_start_locked(ss); in mxge_tx_done()
2762 if ((ss->sc->num_slices > 1) && (tx->req == tx->done)) { in mxge_tx_done()
2772 mtx_unlock(&ss->tx.mtx); in mxge_tx_done()
2964 struct mxge_slice_state *ss = arg; in mxge_intr() local
2965 mxge_softc_t *sc = ss->sc; in mxge_intr()
2966 mcp_irq_data_t *stats = ss->fw_stats; in mxge_intr()
2967 mxge_tx_ring_t *tx = &ss->tx; in mxge_intr()
2968 mxge_rx_done_t *rx_done = &ss->rx_done; in mxge_intr()
2995 mxge_tx_done(ss, (int)send_done_count); in mxge_intr()
2996 mxge_clean_rx_done(ss); in mxge_intr()
3004 if (__predict_false((ss == sc->ss) && stats->stats_updated)) { in mxge_intr()
3035 *ss->irq_claim = be32toh(3); in mxge_intr()
3036 *(ss->irq_claim + 1) = be32toh(3); in mxge_intr()
3052 mxge_free_slice_mbufs(struct mxge_slice_state *ss) in mxge_free_slice_mbufs() argument
3057 tcp_lro_free(&ss->lc); in mxge_free_slice_mbufs()
3059 for (i = 0; i <= ss->rx_big.mask; i++) { in mxge_free_slice_mbufs()
3060 if (ss->rx_big.info[i].m == NULL) in mxge_free_slice_mbufs()
3062 bus_dmamap_unload(ss->rx_big.dmat, in mxge_free_slice_mbufs()
3063 ss->rx_big.info[i].map); in mxge_free_slice_mbufs()
3064 m_freem(ss->rx_big.info[i].m); in mxge_free_slice_mbufs()
3065 ss->rx_big.info[i].m = NULL; in mxge_free_slice_mbufs()
3068 for (i = 0; i <= ss->rx_small.mask; i++) { in mxge_free_slice_mbufs()
3069 if (ss->rx_small.info[i].m == NULL) in mxge_free_slice_mbufs()
3071 bus_dmamap_unload(ss->rx_small.dmat, in mxge_free_slice_mbufs()
3072 ss->rx_small.info[i].map); in mxge_free_slice_mbufs()
3073 m_freem(ss->rx_small.info[i].m); in mxge_free_slice_mbufs()
3074 ss->rx_small.info[i].m = NULL; in mxge_free_slice_mbufs()
3078 if (ss->tx.info == NULL) in mxge_free_slice_mbufs()
3081 for (i = 0; i <= ss->tx.mask; i++) { in mxge_free_slice_mbufs()
3082 ss->tx.info[i].flag = 0; in mxge_free_slice_mbufs()
3083 if (ss->tx.info[i].m == NULL) in mxge_free_slice_mbufs()
3085 bus_dmamap_unload(ss->tx.dmat, in mxge_free_slice_mbufs()
3086 ss->tx.info[i].map); in mxge_free_slice_mbufs()
3087 m_freem(ss->tx.info[i].m); in mxge_free_slice_mbufs()
3088 ss->tx.info[i].m = NULL; in mxge_free_slice_mbufs()
3098 mxge_free_slice_mbufs(&sc->ss[slice]); in mxge_free_mbufs()
3102 mxge_free_slice_rings(struct mxge_slice_state *ss) in mxge_free_slice_rings() argument
3106 if (ss->rx_done.entry != NULL) in mxge_free_slice_rings()
3107 mxge_dma_free(&ss->rx_done.dma); in mxge_free_slice_rings()
3108 ss->rx_done.entry = NULL; in mxge_free_slice_rings()
3110 if (ss->tx.req_bytes != NULL) in mxge_free_slice_rings()
3111 free(ss->tx.req_bytes, M_DEVBUF); in mxge_free_slice_rings()
3112 ss->tx.req_bytes = NULL; in mxge_free_slice_rings()
3114 if (ss->tx.seg_list != NULL) in mxge_free_slice_rings()
3115 free(ss->tx.seg_list, M_DEVBUF); in mxge_free_slice_rings()
3116 ss->tx.seg_list = NULL; in mxge_free_slice_rings()
3118 if (ss->rx_small.shadow != NULL) in mxge_free_slice_rings()
3119 free(ss->rx_small.shadow, M_DEVBUF); in mxge_free_slice_rings()
3120 ss->rx_small.shadow = NULL; in mxge_free_slice_rings()
3122 if (ss->rx_big.shadow != NULL) in mxge_free_slice_rings()
3123 free(ss->rx_big.shadow, M_DEVBUF); in mxge_free_slice_rings()
3124 ss->rx_big.shadow = NULL; in mxge_free_slice_rings()
3126 if (ss->tx.info != NULL) { in mxge_free_slice_rings()
3127 if (ss->tx.dmat != NULL) { in mxge_free_slice_rings()
3128 for (i = 0; i <= ss->tx.mask; i++) { in mxge_free_slice_rings()
3129 bus_dmamap_destroy(ss->tx.dmat, in mxge_free_slice_rings()
3130 ss->tx.info[i].map); in mxge_free_slice_rings()
3132 bus_dma_tag_destroy(ss->tx.dmat); in mxge_free_slice_rings()
3134 free(ss->tx.info, M_DEVBUF); in mxge_free_slice_rings()
3136 ss->tx.info = NULL; in mxge_free_slice_rings()
3138 if (ss->rx_small.info != NULL) { in mxge_free_slice_rings()
3139 if (ss->rx_small.dmat != NULL) { in mxge_free_slice_rings()
3140 for (i = 0; i <= ss->rx_small.mask; i++) { in mxge_free_slice_rings()
3141 bus_dmamap_destroy(ss->rx_small.dmat, in mxge_free_slice_rings()
3142 ss->rx_small.info[i].map); in mxge_free_slice_rings()
3144 bus_dmamap_destroy(ss->rx_small.dmat, in mxge_free_slice_rings()
3145 ss->rx_small.extra_map); in mxge_free_slice_rings()
3146 bus_dma_tag_destroy(ss->rx_small.dmat); in mxge_free_slice_rings()
3148 free(ss->rx_small.info, M_DEVBUF); in mxge_free_slice_rings()
3150 ss->rx_small.info = NULL; in mxge_free_slice_rings()
3152 if (ss->rx_big.info != NULL) { in mxge_free_slice_rings()
3153 if (ss->rx_big.dmat != NULL) { in mxge_free_slice_rings()
3154 for (i = 0; i <= ss->rx_big.mask; i++) { in mxge_free_slice_rings()
3155 bus_dmamap_destroy(ss->rx_big.dmat, in mxge_free_slice_rings()
3156 ss->rx_big.info[i].map); in mxge_free_slice_rings()
3158 bus_dmamap_destroy(ss->rx_big.dmat, in mxge_free_slice_rings()
3159 ss->rx_big.extra_map); in mxge_free_slice_rings()
3160 bus_dma_tag_destroy(ss->rx_big.dmat); in mxge_free_slice_rings()
3162 free(ss->rx_big.info, M_DEVBUF); in mxge_free_slice_rings()
3164 ss->rx_big.info = NULL; in mxge_free_slice_rings()
3173 mxge_free_slice_rings(&sc->ss[slice]); in mxge_free_rings()
3177 mxge_alloc_slice_rings(struct mxge_slice_state *ss, int rx_ring_entries, in mxge_alloc_slice_rings() argument
3180 mxge_softc_t *sc = ss->sc; in mxge_alloc_slice_rings()
3186 ss->rx_small.mask = ss->rx_big.mask = rx_ring_entries - 1; in mxge_alloc_slice_rings()
3187 ss->rx_done.mask = (2 * rx_ring_entries) - 1; in mxge_alloc_slice_rings()
3190 bytes = rx_ring_entries * sizeof (*ss->rx_small.shadow); in mxge_alloc_slice_rings()
3191 ss->rx_small.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); in mxge_alloc_slice_rings()
3193 bytes = rx_ring_entries * sizeof (*ss->rx_big.shadow); in mxge_alloc_slice_rings()
3194 ss->rx_big.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); in mxge_alloc_slice_rings()
3197 bytes = rx_ring_entries * sizeof (*ss->rx_small.info); in mxge_alloc_slice_rings()
3198 ss->rx_small.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); in mxge_alloc_slice_rings()
3200 bytes = rx_ring_entries * sizeof (*ss->rx_big.info); in mxge_alloc_slice_rings()
3201 ss->rx_big.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); in mxge_alloc_slice_rings()
3215 &ss->rx_small.dmat); /* tag */ in mxge_alloc_slice_rings()
3233 &ss->rx_big.dmat); /* tag */ in mxge_alloc_slice_rings()
3239 for (i = 0; i <= ss->rx_small.mask; i++) { in mxge_alloc_slice_rings()
3240 err = bus_dmamap_create(ss->rx_small.dmat, 0, in mxge_alloc_slice_rings()
3241 &ss->rx_small.info[i].map); in mxge_alloc_slice_rings()
3248 err = bus_dmamap_create(ss->rx_small.dmat, 0, in mxge_alloc_slice_rings()
3249 &ss->rx_small.extra_map); in mxge_alloc_slice_rings()
3256 for (i = 0; i <= ss->rx_big.mask; i++) { in mxge_alloc_slice_rings()
3257 err = bus_dmamap_create(ss->rx_big.dmat, 0, in mxge_alloc_slice_rings()
3258 &ss->rx_big.info[i].map); in mxge_alloc_slice_rings()
3265 err = bus_dmamap_create(ss->rx_big.dmat, 0, in mxge_alloc_slice_rings()
3266 &ss->rx_big.extra_map); in mxge_alloc_slice_rings()
3275 ss->tx.mask = tx_ring_entries - 1; in mxge_alloc_slice_rings()
3276 ss->tx.max_desc = MIN(MXGE_MAX_SEND_DESC, tx_ring_entries / 4); in mxge_alloc_slice_rings()
3280 sizeof (*ss->tx.req_list) * (ss->tx.max_desc + 4); in mxge_alloc_slice_rings()
3281 ss->tx.req_bytes = malloc(bytes, M_DEVBUF, M_WAITOK); in mxge_alloc_slice_rings()
3283 ss->tx.req_list = (mcp_kreq_ether_send_t *) in mxge_alloc_slice_rings()
3284 ((uintptr_t)(ss->tx.req_bytes + 7) & ~7UL); in mxge_alloc_slice_rings()
3287 bytes = sizeof (*ss->tx.seg_list) * ss->tx.max_desc; in mxge_alloc_slice_rings()
3288 ss->tx.seg_list = (bus_dma_segment_t *) in mxge_alloc_slice_rings()
3292 bytes = tx_ring_entries * sizeof (*ss->tx.info); in mxge_alloc_slice_rings()
3293 ss->tx.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); in mxge_alloc_slice_rings()
3303 ss->tx.max_desc - 2, /* num segs */ in mxge_alloc_slice_rings()
3307 &ss->tx.dmat); /* tag */ in mxge_alloc_slice_rings()
3317 for (i = 0; i <= ss->tx.mask; i++) { in mxge_alloc_slice_rings()
3318 err = bus_dmamap_create(ss->tx.dmat, 0, in mxge_alloc_slice_rings()
3319 &ss->tx.info[i].map); in mxge_alloc_slice_rings()
3352 err = mxge_alloc_slice_rings(&sc->ss[slice], in mxge_alloc_rings()
3392 mxge_slice_open(struct mxge_slice_state *ss, int nbufs, int cl_size) in mxge_slice_open() argument
3399 sc = ss->sc; in mxge_slice_open()
3400 slice = ss - sc->ss; in mxge_slice_open()
3403 (void)tcp_lro_init(&ss->lc); in mxge_slice_open()
3405 ss->lc.ifp = sc->ifp; in mxge_slice_open()
3413 ss->tx.lanai = in mxge_slice_open()
3415 ss->tx.send_go = (volatile uint32_t *) in mxge_slice_open()
3417 ss->tx.send_stop = (volatile uint32_t *) in mxge_slice_open()
3423 ss->rx_small.lanai = in mxge_slice_open()
3427 ss->rx_big.lanai = in mxge_slice_open()
3437 for (i = 0; i <= ss->rx_small.mask; i++) { in mxge_slice_open()
3438 map = ss->rx_small.info[i].map; in mxge_slice_open()
3439 err = mxge_get_buf_small(ss, map, i); in mxge_slice_open()
3442 i, ss->rx_small.mask + 1); in mxge_slice_open()
3446 for (i = 0; i <= ss->rx_big.mask; i++) { in mxge_slice_open()
3447 ss->rx_big.shadow[i].addr_low = 0xffffffff; in mxge_slice_open()
3448 ss->rx_big.shadow[i].addr_high = 0xffffffff; in mxge_slice_open()
3450 ss->rx_big.nbufs = nbufs; in mxge_slice_open()
3451 ss->rx_big.cl_size = cl_size; in mxge_slice_open()
3452 ss->rx_big.mlen = if_getmtu(ss->sc->ifp) + ETHER_HDR_LEN + in mxge_slice_open()
3454 for (i = 0; i <= ss->rx_big.mask; i += ss->rx_big.nbufs) { in mxge_slice_open()
3455 map = ss->rx_big.info[i].map; in mxge_slice_open()
3456 err = mxge_get_buf_big(ss, map, i); in mxge_slice_open()
3459 i, ss->rx_big.mask + 1); in mxge_slice_open()
3473 struct mxge_slice_state *ss; in mxge_open() local
3543 ss = &sc->ss[slice]; in mxge_open()
3545 MXGE_LOWPART_TO_U32(ss->fw_stats_dma.bus_addr); in mxge_open()
3547 MXGE_HIGHPART_TO_U32(ss->fw_stats_dma.bus_addr); in mxge_open()
3554 bus = sc->ss->fw_stats_dma.bus_addr; in mxge_open()
3573 err = mxge_slice_open(&sc->ss[slice], nbufs, cl_size); in mxge_open()
3588 ss = &sc->ss[slice]; in mxge_open()
3589 ss->if_drv_flags |= IFF_DRV_RUNNING; in mxge_open()
3590 ss->if_drv_flags &= ~IFF_DRV_OACTIVE; in mxge_open()
3608 struct mxge_slice_state *ss; in mxge_close() local
3612 ss = &sc->ss[slice]; in mxge_close()
3613 ss->if_drv_flags &= ~IFF_DRV_RUNNING; in mxge_close()
3688 struct mxge_slice_state *ss; in mxge_watchdog_reset() local
3740 ss = &sc->ss[s]; in mxge_watchdog_reset()
3741 mtx_lock(&ss->tx.mtx); in mxge_watchdog_reset()
3763 ss = &sc->ss[s]; in mxge_watchdog_reset()
3764 mxge_start_locked(ss); in mxge_watchdog_reset()
3765 mtx_unlock(&ss->tx.mtx); in mxge_watchdog_reset()
3796 tx = &sc->ss[slice].tx; in mxge_warn_stuck()
3805 be32toh(sc->ss->fw_stats->send_done_count)); in mxge_warn_stuck()
3812 uint32_t rx_pause = be32toh(sc->ss->fw_stats->dropped_pause); in mxge_watchdog()
3818 tx = &sc->ss[i].tx; in mxge_watchdog()
3855 rv += sc->ss[s].ipackets; in mxge_get_counter()
3859 rv += sc->ss[s].opackets; in mxge_get_counter()
3863 rv += sc->ss[s].oerrors; in mxge_get_counter()
3867 rv += sc->ss[s].obytes; in mxge_get_counter()
3871 rv += sc->ss[s].omcasts; in mxge_get_counter()
3875 rv += sc->ss[s].tx.br->br_drops; in mxge_get_counter()
4220 struct mxge_slice_state *ss; in mxge_free_slices() local
4223 if (sc->ss == NULL) in mxge_free_slices()
4227 ss = &sc->ss[i]; in mxge_free_slices()
4228 if (ss->fw_stats != NULL) { in mxge_free_slices()
4229 mxge_dma_free(&ss->fw_stats_dma); in mxge_free_slices()
4230 ss->fw_stats = NULL; in mxge_free_slices()
4231 if (ss->tx.br != NULL) { in mxge_free_slices()
4232 drbr_free(ss->tx.br, M_DEVBUF); in mxge_free_slices()
4233 ss->tx.br = NULL; in mxge_free_slices()
4235 mtx_destroy(&ss->tx.mtx); in mxge_free_slices()
4237 if (ss->rx_done.entry != NULL) { in mxge_free_slices()
4238 mxge_dma_free(&ss->rx_done.dma); in mxge_free_slices()
4239 ss->rx_done.entry = NULL; in mxge_free_slices()
4242 free(sc->ss, M_DEVBUF); in mxge_free_slices()
4243 sc->ss = NULL; in mxge_free_slices()
4250 struct mxge_slice_state *ss; in mxge_alloc_slices() local
4262 bytes = sizeof (*sc->ss) * sc->num_slices; in mxge_alloc_slices()
4263 sc->ss = malloc(bytes, M_DEVBUF, M_NOWAIT | M_ZERO); in mxge_alloc_slices()
4264 if (sc->ss == NULL) in mxge_alloc_slices()
4267 ss = &sc->ss[i]; in mxge_alloc_slices()
4269 ss->sc = sc; in mxge_alloc_slices()
4273 bytes = max_intr_slots * sizeof (*ss->rx_done.entry); in mxge_alloc_slices()
4274 err = mxge_dma_alloc(sc, &ss->rx_done.dma, bytes, 4096); in mxge_alloc_slices()
4277 ss->rx_done.entry = ss->rx_done.dma.addr; in mxge_alloc_slices()
4278 bzero(ss->rx_done.entry, bytes); in mxge_alloc_slices()
4286 bytes = sizeof (*ss->fw_stats); in mxge_alloc_slices()
4287 err = mxge_dma_alloc(sc, &ss->fw_stats_dma, in mxge_alloc_slices()
4288 sizeof (*ss->fw_stats), 64); in mxge_alloc_slices()
4291 ss->fw_stats = (mcp_irq_data_t *)ss->fw_stats_dma.addr; in mxge_alloc_slices()
4292 snprintf(ss->tx.mtx_name, sizeof(ss->tx.mtx_name), in mxge_alloc_slices()
4294 mtx_init(&ss->tx.mtx, ss->tx.mtx_name, NULL, MTX_DEF); in mxge_alloc_slices()
4295 ss->tx.br = buf_ring_alloc(2048, M_DEVBUF, M_WAITOK, in mxge_alloc_slices()
4296 &ss->tx.mtx); in mxge_alloc_slices()
4455 mxge_intr, &sc->ss[i], &sc->msix_ih[i]); in mxge_add_msix_irqs()
4528 mxge_intr, &sc->ss[0], &sc->ih); in mxge_add_single_irq()
4757 sizeof (sc->ss[0].scratch)); in mxge_attach()
4769 if_sethwtsomaxsegcount(ifp, sc->ss[0].tx.max_desc); in mxge_attach()