Lines Matching refs:rx_mod
1741 bna_rx_res_check(struct bna_rx_mod *rx_mod, struct bna_rx_config *rx_cfg) in bna_rx_res_check() argument
1743 if ((rx_mod->rx_free_count == 0) || in bna_rx_res_check()
1744 (rx_mod->rxp_free_count == 0) || in bna_rx_res_check()
1745 (rx_mod->rxq_free_count == 0)) in bna_rx_res_check()
1749 if ((rx_mod->rxp_free_count < rx_cfg->num_paths) || in bna_rx_res_check()
1750 (rx_mod->rxq_free_count < rx_cfg->num_paths)) in bna_rx_res_check()
1753 if ((rx_mod->rxp_free_count < rx_cfg->num_paths) || in bna_rx_res_check()
1754 (rx_mod->rxq_free_count < (2 * rx_cfg->num_paths))) in bna_rx_res_check()
1762 bna_rxq_get(struct bna_rx_mod *rx_mod) in bna_rxq_get() argument
1766 rxq = list_first_entry(&rx_mod->rxq_free_q, struct bna_rxq, qe); in bna_rxq_get()
1768 rx_mod->rxq_free_count--; in bna_rxq_get()
1774 bna_rxq_put(struct bna_rx_mod *rx_mod, struct bna_rxq *rxq) in bna_rxq_put() argument
1776 list_add_tail(&rxq->qe, &rx_mod->rxq_free_q); in bna_rxq_put()
1777 rx_mod->rxq_free_count++; in bna_rxq_put()
1781 bna_rxp_get(struct bna_rx_mod *rx_mod) in bna_rxp_get() argument
1785 rxp = list_first_entry(&rx_mod->rxp_free_q, struct bna_rxp, qe); in bna_rxp_get()
1787 rx_mod->rxp_free_count--; in bna_rxp_get()
1793 bna_rxp_put(struct bna_rx_mod *rx_mod, struct bna_rxp *rxp) in bna_rxp_put() argument
1795 list_add_tail(&rxp->qe, &rx_mod->rxp_free_q); in bna_rxp_put()
1796 rx_mod->rxp_free_count++; in bna_rxp_put()
1800 bna_rx_get(struct bna_rx_mod *rx_mod, enum bna_rx_type type) in bna_rx_get() argument
1804 BUG_ON(list_empty(&rx_mod->rx_free_q)); in bna_rx_get()
1806 rx = list_first_entry(&rx_mod->rx_free_q, struct bna_rx, qe); in bna_rx_get()
1808 rx = list_last_entry(&rx_mod->rx_free_q, struct bna_rx, qe); in bna_rx_get()
1810 rx_mod->rx_free_count--; in bna_rx_get()
1811 list_move_tail(&rx->qe, &rx_mod->rx_active_q); in bna_rx_get()
1818 bna_rx_put(struct bna_rx_mod *rx_mod, struct bna_rx *rx) in bna_rx_put() argument
1822 list_for_each_prev(qe, &rx_mod->rx_free_q) in bna_rx_put()
1827 rx_mod->rx_free_count++; in bna_rx_put()
1932 struct bna_rx_mod *rx_mod = (struct bna_rx_mod *)arg; in bna_rx_mod_cb_rx_stopped() local
1934 bfa_wc_down(&rx_mod->rx_stop_wc); in bna_rx_mod_cb_rx_stopped()
1940 struct bna_rx_mod *rx_mod = (struct bna_rx_mod *)arg; in bna_rx_mod_cb_rx_stopped_all() local
1942 if (rx_mod->stop_cbfn) in bna_rx_mod_cb_rx_stopped_all()
1943 rx_mod->stop_cbfn(&rx_mod->bna->enet); in bna_rx_mod_cb_rx_stopped_all()
1944 rx_mod->stop_cbfn = NULL; in bna_rx_mod_cb_rx_stopped_all()
1960 bna_rx_mod_cb_rx_stopped(&rx->bna->rx_mod, rx); in bna_rx_stop()
1963 rx->stop_cbarg = &rx->bna->rx_mod; in bna_rx_stop()
1977 bna_rx_mod_start(struct bna_rx_mod *rx_mod, enum bna_rx_type type) in bna_rx_mod_start() argument
1981 rx_mod->flags |= BNA_RX_MOD_F_ENET_STARTED; in bna_rx_mod_start()
1983 rx_mod->flags |= BNA_RX_MOD_F_ENET_LOOPBACK; in bna_rx_mod_start()
1985 list_for_each_entry(rx, &rx_mod->rx_active_q, qe) in bna_rx_mod_start()
1991 bna_rx_mod_stop(struct bna_rx_mod *rx_mod, enum bna_rx_type type) in bna_rx_mod_stop() argument
1995 rx_mod->flags &= ~BNA_RX_MOD_F_ENET_STARTED; in bna_rx_mod_stop()
1996 rx_mod->flags &= ~BNA_RX_MOD_F_ENET_LOOPBACK; in bna_rx_mod_stop()
1998 rx_mod->stop_cbfn = bna_enet_cb_rx_stopped; in bna_rx_mod_stop()
2000 bfa_wc_init(&rx_mod->rx_stop_wc, bna_rx_mod_cb_rx_stopped_all, rx_mod); in bna_rx_mod_stop()
2002 list_for_each_entry(rx, &rx_mod->rx_active_q, qe) in bna_rx_mod_stop()
2004 bfa_wc_up(&rx_mod->rx_stop_wc); in bna_rx_mod_stop()
2008 bfa_wc_wait(&rx_mod->rx_stop_wc); in bna_rx_mod_stop()
2012 bna_rx_mod_fail(struct bna_rx_mod *rx_mod) in bna_rx_mod_fail() argument
2016 rx_mod->flags &= ~BNA_RX_MOD_F_ENET_STARTED; in bna_rx_mod_fail()
2017 rx_mod->flags &= ~BNA_RX_MOD_F_ENET_LOOPBACK; in bna_rx_mod_fail()
2019 list_for_each_entry(rx, &rx_mod->rx_active_q, qe) in bna_rx_mod_fail()
2023 void bna_rx_mod_init(struct bna_rx_mod *rx_mod, struct bna *bna, in bna_rx_mod_init() argument
2031 rx_mod->bna = bna; in bna_rx_mod_init()
2032 rx_mod->flags = 0; in bna_rx_mod_init()
2034 rx_mod->rx = (struct bna_rx *) in bna_rx_mod_init()
2036 rx_mod->rxp = (struct bna_rxp *) in bna_rx_mod_init()
2038 rx_mod->rxq = (struct bna_rxq *) in bna_rx_mod_init()
2042 INIT_LIST_HEAD(&rx_mod->rx_free_q); in bna_rx_mod_init()
2043 rx_mod->rx_free_count = 0; in bna_rx_mod_init()
2044 INIT_LIST_HEAD(&rx_mod->rxq_free_q); in bna_rx_mod_init()
2045 rx_mod->rxq_free_count = 0; in bna_rx_mod_init()
2046 INIT_LIST_HEAD(&rx_mod->rxp_free_q); in bna_rx_mod_init()
2047 rx_mod->rxp_free_count = 0; in bna_rx_mod_init()
2048 INIT_LIST_HEAD(&rx_mod->rx_active_q); in bna_rx_mod_init()
2052 rx_ptr = &rx_mod->rx[index]; in bna_rx_mod_init()
2060 list_add_tail(&rx_ptr->qe, &rx_mod->rx_free_q); in bna_rx_mod_init()
2061 rx_mod->rx_free_count++; in bna_rx_mod_init()
2066 rxp_ptr = &rx_mod->rxp[index]; in bna_rx_mod_init()
2067 list_add_tail(&rxp_ptr->qe, &rx_mod->rxp_free_q); in bna_rx_mod_init()
2068 rx_mod->rxp_free_count++; in bna_rx_mod_init()
2073 rxq_ptr = &rx_mod->rxq[index]; in bna_rx_mod_init()
2074 list_add_tail(&rxq_ptr->qe, &rx_mod->rxq_free_q); in bna_rx_mod_init()
2075 rx_mod->rxq_free_count++; in bna_rx_mod_init()
2080 bna_rx_mod_uninit(struct bna_rx_mod *rx_mod) in bna_rx_mod_uninit() argument
2082 rx_mod->bna = NULL; in bna_rx_mod_uninit()
2256 struct bna_rx_mod *rx_mod = &bna->rx_mod; in bna_rx_create() local
2280 if (!bna_rx_res_check(rx_mod, rx_cfg)) in bna_rx_create()
2307 rx = bna_rx_get(rx_mod, rx_cfg->rx_type); in bna_rx_create()
2324 if (rx->bna->rx_mod.flags & BNA_RX_MOD_F_ENET_STARTED) { in bna_rx_create()
2327 if (!(rx->bna->rx_mod.flags & in bna_rx_create()
2332 if (rx->bna->rx_mod.flags & BNA_RX_MOD_F_ENET_LOOPBACK) in bna_rx_create()
2341 rxp = bna_rxp_get(rx_mod); in bna_rx_create()
2347 q0 = bna_rxq_get(rx_mod); in bna_rx_create()
2351 q1 = bna_rxq_get(rx_mod); in bna_rx_create()
2477 rx_mod->rid_mask |= BIT(rx->rid); in bna_rx_create()
2485 struct bna_rx_mod *rx_mod = &rx->bna->rx_mod; in bna_rx_destroy() local
2502 bna_rxq_put(rx_mod, q0); in bna_rx_destroy()
2510 bna_rxq_put(rx_mod, q1); in bna_rx_destroy()
2519 bna_rxp_put(rx_mod, rxp); in bna_rx_destroy()
2522 list_for_each(qe, &rx_mod->rx_active_q) in bna_rx_destroy()
2528 rx_mod->rid_mask &= ~BIT(rx->rid); in bna_rx_destroy()
2532 bna_rx_put(rx_mod, rx); in bna_rx_destroy()
2691 bna->rx_mod.dim_vector[i][j] = vector[i][j]; in bna_rx_dim_reconfig()
2738 coalescing_timeo = bna->rx_mod.dim_vector[load][bias]; in bna_rx_dim_update()