Lines Matching refs:rx
1024 struct mvneta_rx_ring *rx; in mvneta_portdown() local
1030 rx = MVNETA_RX_RING(sc, q); in mvneta_portdown()
1032 rx->queue_status = MVNETA_QUEUE_DISABLED; in mvneta_portdown()
1217 struct mvneta_rx_ring *rx; in mvneta_ring_alloc_rx_queue() local
1225 rx = MVNETA_RX_RING(sc, q); in mvneta_ring_alloc_rx_queue()
1226 mtx_init(&rx->ring_mtx, "mvneta_rx", NULL, MTX_DEF); in mvneta_ring_alloc_rx_queue()
1229 (void**)&(rx->desc), in mvneta_ring_alloc_rx_queue()
1231 &rx->desc_map); in mvneta_ring_alloc_rx_queue()
1232 if (error != 0 || rx->desc == NULL) in mvneta_ring_alloc_rx_queue()
1234 error = bus_dmamap_load(sc->rx_dtag, rx->desc_map, in mvneta_ring_alloc_rx_queue()
1235 rx->desc, in mvneta_ring_alloc_rx_queue()
1237 mvneta_dmamap_cb, &rx->desc_pa, BUS_DMA_NOWAIT); in mvneta_ring_alloc_rx_queue()
1248 rxbuf = &rx->rxbuf[i]; in mvneta_ring_alloc_rx_queue()
1364 struct mvneta_rx_ring *rx; in mvneta_ring_dealloc_rx_queue() local
1371 rx = MVNETA_RX_RING(sc, q); in mvneta_ring_dealloc_rx_queue()
1375 if (rx->desc_pa != 0) in mvneta_ring_dealloc_rx_queue()
1376 bus_dmamap_unload(sc->rx_dtag, rx->desc_map); in mvneta_ring_dealloc_rx_queue()
1378 kva = (void *)rx->desc; in mvneta_ring_dealloc_rx_queue()
1380 bus_dmamem_free(sc->rx_dtag, rx->desc, rx->desc_map); in mvneta_ring_dealloc_rx_queue()
1382 lro = &rx->lro; in mvneta_ring_dealloc_rx_queue()
1385 if (mtx_name(&rx->ring_mtx) != NULL) in mvneta_ring_dealloc_rx_queue()
1386 mtx_destroy(&rx->ring_mtx); in mvneta_ring_dealloc_rx_queue()
1388 memset(rx, 0, sizeof(*rx)); in mvneta_ring_dealloc_rx_queue()
1394 struct mvneta_rx_ring *rx; in mvneta_ring_init_rx_queue() local
1401 rx = MVNETA_RX_RING(sc, q); in mvneta_ring_init_rx_queue()
1402 rx->dma = rx->cpu = 0; in mvneta_ring_init_rx_queue()
1403 rx->queue_th_received = MVNETA_RXTH_COUNT; in mvneta_ring_init_rx_queue()
1404 rx->queue_th_time = (mvneta_get_clk() / 1000) / 10; /* 0.1 [ms] */ in mvneta_ring_init_rx_queue()
1407 rx->lro_enabled = FALSE; in mvneta_ring_init_rx_queue()
1409 lro = &rx->lro; in mvneta_ring_init_rx_queue()
1414 rx->lro_enabled = TRUE; in mvneta_ring_init_rx_queue()
1490 struct mvneta_rx_ring *rx; in mvneta_ring_flush_rx_queue() local
1494 rx = MVNETA_RX_RING(sc, q); in mvneta_ring_flush_rx_queue()
1499 rxbuf = &rx->rxbuf[i]; in mvneta_ring_flush_rx_queue()
1502 rx->dma = rx->cpu = 0; in mvneta_ring_flush_rx_queue()
1512 struct mvneta_rx_ring *rx; in mvneta_rx_queue_init() local
1517 rx = MVNETA_RX_RING(sc, q); in mvneta_rx_queue_init()
1518 DASSERT(rx->desc_pa != 0); in mvneta_rx_queue_init()
1521 MVNETA_WRITE(sc, MVNETA_PRXDQA(q), rx->desc_pa); in mvneta_rx_queue_init()
1540 DASSERT(MVNETA_READ(sc, MVNETA_PRXDQA(q)) == rx->desc_pa); in mvneta_rx_queue_init()
1572 struct mvneta_rx_ring *rx; in mvneta_rx_queue_enable() local
1576 rx = MVNETA_RX_RING(sc, q); in mvneta_rx_queue_enable()
1580 reg = MVNETA_PRXDQTH_ODT(rx->queue_th_received); in mvneta_rx_queue_enable()
1583 reg = MVNETA_PRXITTH_RITT(rx->queue_th_time); in mvneta_rx_queue_enable()
1596 rx->queue_status = MVNETA_QUEUE_WORKING; in mvneta_rx_queue_enable()
1773 struct mvneta_rx_ring *rx; in mvneta_tick() local
1807 rx = MVNETA_RX_RING(sc, q); in mvneta_tick()
1808 if (rx->needs_refill == TRUE) { in mvneta_tick()
2066 struct mvneta_rx_ring *rx; in mvneta_ioctl() local
2120 rx = MVNETA_RX_RING(sc, q); in mvneta_ioctl()
2121 rx->lro_enabled = !rx->lro_enabled; in mvneta_ioctl()
2279 struct mvneta_rx_ring *rx; in mvneta_stop_locked() local
2305 rx = MVNETA_RX_RING(sc, q); in mvneta_stop_locked()
3020 struct mvneta_rx_ring *rx; in mvneta_rx_queue() local
3032 rx = MVNETA_RX_RING(sc, q); in mvneta_rx_queue()
3035 if (__predict_false(rx->queue_status == MVNETA_QUEUE_DISABLED)) in mvneta_rx_queue()
3038 bus_dmamap_sync(sc->rx_dtag, rx->desc_map, in mvneta_rx_queue()
3043 ndma = rx_counter_adv(rx->dma, 1); in mvneta_rx_queue()
3044 mvneta_prefetch(&rx->desc[ndma]); in mvneta_rx_queue()
3045 mvneta_prefetch(&rx->rxbuf[ndma]); in mvneta_rx_queue()
3048 r = &rx->desc[rx->dma]; in mvneta_rx_queue()
3049 rxbuf = &rx->rxbuf[rx->dma]; in mvneta_rx_queue()
3073 pktbuf = (uint8_t *)rx->rxbuf_virt_addr[rx->dma] + MVNETA_PACKET_OFFSET + in mvneta_rx_queue()
3086 rx->dma = ndma; in mvneta_rx_queue()
3088 if (__predict_false(rx->lro_enabled && in mvneta_rx_queue()
3094 if (rx->lro.lro_cnt != 0) { in mvneta_rx_queue()
3095 if (tcp_lro_rx(&rx->lro, m, 0) == 0) in mvneta_rx_queue()
3107 if(__predict_false(rx->queue_status == MVNETA_QUEUE_DISABLED)) in mvneta_rx_queue()
3119 rx->dma = ndma; in mvneta_rx_queue()
3139 lro = &rx->lro; in mvneta_rx_queue()
3158 struct mvneta_rx_ring *rx; in mvneta_rx_queue_refill() local
3168 rx = MVNETA_RX_RING(sc, q); in mvneta_rx_queue_refill()
3180 rxbuf = &rx->rxbuf[rx->cpu]; in mvneta_rx_queue_refill()
3198 r = &rx->desc[rx->cpu]; in mvneta_rx_queue_refill()
3200 rx->rxbuf_virt_addr[rx->cpu] = m->m_data; in mvneta_rx_queue_refill()
3202 rx->cpu = rx_counter_adv(rx->cpu, 1); in mvneta_rx_queue_refill()
3206 rx->needs_refill = TRUE; in mvneta_rx_queue_refill()
3210 rx->needs_refill = FALSE; in mvneta_rx_queue_refill()
3211 bus_dmamap_sync(sc->rx_dtag, rx->desc_map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); in mvneta_rx_queue_refill()
3386 struct mvneta_rx_ring *rx; in sysctl_set_queue_rxthtime() local
3391 rx = NULL; in sysctl_set_queue_rxthtime()
3407 rx = MVNETA_RX_RING(sc, arg->queue); in sysctl_set_queue_rxthtime()
3408 time_mvtclk = rx->queue_th_time; in sysctl_set_queue_rxthtime()
3428 rx->queue_th_time = time_mvtclk; in sysctl_set_queue_rxthtime()
3429 reg = MVNETA_PRXITTH_RITT(rx->queue_th_time); in sysctl_set_queue_rxthtime()