Lines Matching refs:sp

161 	sfxge_t *sp = arg;  in sfxge_tx_buffer_ctor()  local
167 dma_attr.sdba_dip = sp->s_dip; in sfxge_tx_buffer_ctor()
207 sfxge_t *sp = arg; in sfxge_tx_mapping_ctor() local
208 dev_info_t *dip = sp->s_dip; in sfxge_tx_mapping_ctor()
213 stmp->stm_sp = sp; in sfxge_tx_mapping_ctor()
255 sfxge_t *sp = arg; in sfxge_tx_qctor() local
272 stp->st_sp = sp; in sfxge_tx_qctor()
274 dma_attr.sdba_dip = sp->s_dip; in sfxge_tx_qctor()
288 if ((rc = sfxge_sram_buf_tbl_alloc(sp, EFX_TXQ_NBUFS(SFXGE_TX_NDESCS), in sfxge_tx_qctor()
351 sfxge_sram_buf_tbl_free(sp, stp->st_id, EFX_TXQ_NBUFS(SFXGE_TX_NDESCS)); in sfxge_tx_qctor()
375 sfxge_t *sp = stp->st_sp; in sfxge_tx_qdtor() local
404 sfxge_sram_buf_tbl_free(sp, stp->st_id, EFX_TXQ_NBUFS(SFXGE_TX_NDESCS)); in sfxge_tx_qdtor()
416 sfxge_tx_packet_destroy(sfxge_t *sp, sfxge_tx_packet_t *stpp) in sfxge_tx_packet_destroy() argument
418 kmem_cache_free(sp->s_tpc, stpp); in sfxge_tx_packet_destroy()
422 sfxge_tx_packet_create(sfxge_t *sp) in sfxge_tx_packet_create() argument
426 stpp = kmem_cache_alloc(sp->s_tpc, KM_NOSLEEP); in sfxge_tx_packet_create()
492 sfxge_t *sp = stp->st_sp; in sfxge_tx_qfpp_empty() local
510 sfxge_tx_packet_destroy(sp, stpp); in sfxge_tx_qfpp_empty()
563 sfxge_t *sp = stp->st_sp; in sfxge_tx_qfbp_empty() local
581 kmem_cache_free(sp->s_tbc, stbp); in sfxge_tx_qfbp_empty()
634 sfxge_t *sp = stp->st_sp; in sfxge_tx_qfmp_empty() local
652 kmem_cache_free(sp->s_tmc, stmp); in sfxge_tx_qfmp_empty()
1027 sfxge_t *sp = stp->st_sp; in sfxge_tx_kstat_init() local
1029 dev_info_t *dip = sp->s_dip; in sfxge_tx_kstat_init()
1056 kstat_named_init(knp, (char *)efx_tx_qstat_name(sp->s_enp, id), in sfxge_tx_kstat_init()
1087 sfxge_tx_qinit(sfxge_t *sp, unsigned int index, sfxge_txq_type_t type, in sfxge_tx_qinit() argument
1094 ASSERT3U(index, <, EFX_ARRAY_SIZE(sp->s_stp)); in sfxge_tx_qinit()
1096 ASSERT3U(evq, <, EFX_ARRAY_SIZE(sp->s_sep)); in sfxge_tx_qinit()
1098 if ((stp = kmem_cache_alloc(sp->s_tqc, KM_SLEEP)) == NULL) { in sfxge_tx_qinit()
1111 DDI_INTR_PRI(sp->s_intr.si_intr_pri)); in sfxge_tx_qinit()
1117 stdp->get_pkt_limit = ddi_prop_get_int(DDI_DEV_T_ANY, sp->s_dip, in sfxge_tx_qinit()
1121 stdp->put_pkt_limit = ddi_prop_get_int(DDI_DEV_T_ANY, sp->s_dip, in sfxge_tx_qinit()
1126 if ((rc = sfxge_ev_txlabel_alloc(sp, evq, stp, &(stp->st_label))) != 0) in sfxge_tx_qinit()
1132 ASSERT3P(sp->s_stp[index], ==, NULL); in sfxge_tx_qinit()
1133 sp->s_stp[index] = stp; in sfxge_tx_qinit()
1134 sp->s_tx_qcount++; in sfxge_tx_qinit()
1150 kmem_cache_free(sp->s_tqc, stp); in sfxge_tx_qinit()
1159 sfxge_tx_qstart(sfxge_t *sp, unsigned int index) in sfxge_tx_qstart() argument
1161 sfxge_txq_t *stp = sp->s_stp[index]; in sfxge_tx_qstart()
1162 efx_nic_t *enp = sp->s_enp; in sfxge_tx_qstart()
1174 sep = sp->s_sep[evq]; in sfxge_tx_qstart()
1183 if ((rc = sfxge_sram_buf_tbl_set(sp, stp->st_id, esmp, in sfxge_tx_qstart()
1232 sfxge_sram_buf_tbl_clear(sp, stp->st_id, in sfxge_tx_qstart()
1403 sfxge_t *sp = stp->st_sp; in sfxge_tx_qpayload_fragment() local
1455 if ((stmp = kmem_cache_alloc(sp->s_tmc, in sfxge_tx_qpayload_fragment()
1508 if ((stbp = kmem_cache_alloc(sp->s_tbc, in sfxge_tx_qpayload_fragment()
1567 sfxge_t *sp = stp->st_sp; in sfxge_tx_qlso_fragment() local
1691 if ((stbp = kmem_cache_alloc(sp->s_tbc, in sfxge_tx_qlso_fragment()
1781 sfxge_t *sp = stp->st_sp; in sfxge_tx_qpacket_fragment() local
1841 if ((stmp = kmem_cache_alloc(sp->s_tmc, in sfxge_tx_qpacket_fragment()
1886 if ((stbp = kmem_cache_alloc(sp->s_tbc, in sfxge_tx_qpacket_fragment()
2086 sfxge_t *sp = stp->st_sp; in sfxge_tx_qdpl_drain() local
2094 prefetch_read_many(sp->s_enp); in sfxge_tx_qdpl_drain()
2152 sfxge_tx_packet_destroy(sp, stpp); in sfxge_tx_qdpl_drain()
2200 sfxge_tx_packet_destroy(sp, stpp); in sfxge_tx_qdpl_drain()
2256 sfxge_t *sp = stp->st_sp; in sfxge_tx_qdpl_flush_locked() local
2288 sfxge_tx_packet_destroy(sp, stpp); in sfxge_tx_qdpl_flush_locked()
2315 sfxge_t *sp = stp->st_sp; in sfxge_tx_qunblock() local
2317 sfxge_evq_t *sep = sp->s_sep[evq]; in sfxge_tx_qunblock()
2345 sfxge_t *sp = stp->st_sp; in sfxge_tx_qcomplete() local
2348 sfxge_evq_t *sep = sp->s_sep[evq]; in sfxge_tx_qcomplete()
2395 mac_tx_update(sp->s_mh); in sfxge_tx_qcomplete()
2401 sfxge_t *sp = stp->st_sp; in sfxge_tx_qflush_done() local
2404 ASSERT(mutex_owned(&(sp->s_sep[stp->st_evq]->se_lock))); in sfxge_tx_qflush_done()
2448 mutex_enter(&(sp->s_tx_flush_lock)); in sfxge_tx_qflush_done()
2449 sp->s_tx_flush_pending--; in sfxge_tx_qflush_done()
2450 if (sp->s_tx_flush_pending <= 0) { in sfxge_tx_qflush_done()
2452 cv_signal(&(sp->s_tx_flush_kv)); in sfxge_tx_qflush_done()
2454 mutex_exit(&(sp->s_tx_flush_lock)); in sfxge_tx_qflush_done()
2458 sfxge_tx_qflush(sfxge_t *sp, unsigned int index, boolean_t wait_for_flush) in sfxge_tx_qflush() argument
2460 sfxge_txq_t *stp = sp->s_stp[index]; in sfxge_tx_qflush()
2463 ASSERT(mutex_owned(&(sp->s_state_lock))); in sfxge_tx_qflush()
2464 ASSERT(mutex_owned(&(sp->s_tx_flush_lock))); in sfxge_tx_qflush()
2479 sp->s_tx_flush_pending++; in sfxge_tx_qflush()
2490 sfxge_tx_qstop(sfxge_t *sp, unsigned int index) in sfxge_tx_qstop() argument
2492 sfxge_txq_t *stp = sp->s_stp[index]; in sfxge_tx_qstop()
2494 sfxge_evq_t *sep = sp->s_sep[evq]; in sfxge_tx_qstop()
2508 dev_err(sp->s_dip, CE_NOTE, in sfxge_tx_qstop()
2513 dev_err(sp->s_dip, CE_NOTE, in sfxge_tx_qstop()
2522 sfxge_sram_buf_tbl_clear(sp, stp->st_id, in sfxge_tx_qstop()
2557 sfxge_tx_qfini(sfxge_t *sp, unsigned int index) in sfxge_tx_qfini() argument
2559 sfxge_txq_t *stp = sp->s_stp[index]; in sfxge_tx_qfini()
2566 sp->s_stp[index] = NULL; in sfxge_tx_qfini()
2567 ASSERT(sp->s_tx_qcount > 0); in sfxge_tx_qfini()
2568 sp->s_tx_qcount--; in sfxge_tx_qfini()
2571 (void) sfxge_ev_txlabel_free(sp, stp->st_evq, stp, stp->st_label); in sfxge_tx_qfini()
2597 kmem_cache_free(sp->s_tqc, stp); in sfxge_tx_qfini()
2601 sfxge_tx_init(sfxge_t *sp) in sfxge_tx_init() argument
2603 sfxge_intr_t *sip = &(sp->s_intr); in sfxge_tx_init()
2611 ddi_driver_name(sp->s_dip), ddi_get_instance(sp->s_dip)); in sfxge_tx_init()
2613 sp->s_tpc = kmem_cache_create(name, sizeof (sfxge_tx_packet_t), in sfxge_tx_init()
2615 NULL, sp, NULL, 0); in sfxge_tx_init()
2616 ASSERT(sp->s_tpc != NULL); in sfxge_tx_init()
2619 ddi_driver_name(sp->s_dip), ddi_get_instance(sp->s_dip)); in sfxge_tx_init()
2621 sp->s_tbc = kmem_cache_create(name, sizeof (sfxge_tx_buffer_t), in sfxge_tx_init()
2623 NULL, sp, NULL, 0); in sfxge_tx_init()
2624 ASSERT(sp->s_tbc != NULL); in sfxge_tx_init()
2627 ddi_driver_name(sp->s_dip), ddi_get_instance(sp->s_dip)); in sfxge_tx_init()
2629 sp->s_tmc = kmem_cache_create(name, sizeof (sfxge_tx_mapping_t), in sfxge_tx_init()
2631 NULL, sp, NULL, 0); in sfxge_tx_init()
2632 ASSERT(sp->s_tmc != NULL); in sfxge_tx_init()
2635 ddi_driver_name(sp->s_dip), ddi_get_instance(sp->s_dip)); in sfxge_tx_init()
2637 sp->s_tqc = kmem_cache_create(name, sizeof (sfxge_txq_t), in sfxge_tx_init()
2638 SFXGE_CPU_CACHE_SIZE, sfxge_tx_qctor, sfxge_tx_qdtor, NULL, sp, in sfxge_tx_init()
2640 ASSERT(sp->s_tqc != NULL); in sfxge_tx_init()
2643 sp->s_tx_scale_max[SFXGE_TXQ_NON_CKSUM] = sip->si_nalloc; in sfxge_tx_init()
2644 sp->s_tx_scale_max[SFXGE_TXQ_IP_CKSUM] = 1; in sfxge_tx_init()
2645 sp->s_tx_scale_max[SFXGE_TXQ_IP_TCP_UDP_CKSUM] = sip->si_nalloc; in sfxge_tx_init()
2648 if (sp->s_tx_scale_max[SFXGE_TXQ_NON_CKSUM] < 1) in sfxge_tx_init()
2649 sp->s_tx_scale_max[SFXGE_TXQ_NON_CKSUM] = 1; in sfxge_tx_init()
2651 if (sp->s_tx_scale_max[SFXGE_TXQ_IP_CKSUM] < 1) in sfxge_tx_init()
2652 sp->s_tx_scale_max[SFXGE_TXQ_IP_CKSUM] = 1; in sfxge_tx_init()
2656 unsigned int tx_scale = sp->s_tx_scale_max[qtype]; in sfxge_tx_init()
2658 if (txq + tx_scale > EFX_ARRAY_SIZE(sp->s_stp)) { in sfxge_tx_init()
2663 sp->s_tx_scale_base[qtype] = txq; in sfxge_tx_init()
2666 if ((rc = sfxge_tx_qinit(sp, txq, qtype, evq)) != 0) { in sfxge_tx_init()
2671 ASSERT3U(txq, <=, EFX_ARRAY_SIZE(sp->s_stp)); in sfxge_tx_init()
2682 index = EFX_ARRAY_SIZE(sp->s_stp); in sfxge_tx_init()
2684 if (sp->s_stp[index] != NULL) in sfxge_tx_init()
2685 sfxge_tx_qfini(sp, index); in sfxge_tx_init()
2688 kmem_cache_destroy(sp->s_tqc); in sfxge_tx_init()
2689 sp->s_tqc = NULL; in sfxge_tx_init()
2691 kmem_cache_destroy(sp->s_tmc); in sfxge_tx_init()
2692 sp->s_tmc = NULL; in sfxge_tx_init()
2694 kmem_cache_destroy(sp->s_tbc); in sfxge_tx_init()
2695 sp->s_tbc = NULL; in sfxge_tx_init()
2697 kmem_cache_destroy(sp->s_tpc); in sfxge_tx_init()
2698 sp->s_tpc = NULL; in sfxge_tx_init()
2704 sfxge_tx_start(sfxge_t *sp) in sfxge_tx_start() argument
2706 efx_nic_t *enp = sp->s_enp; in sfxge_tx_start()
2714 for (index = 0; index < EFX_ARRAY_SIZE(sp->s_stp); index++) { in sfxge_tx_start()
2715 if (sp->s_stp[index] != NULL) in sfxge_tx_start()
2716 if ((rc = sfxge_tx_qstart(sp, index)) != 0) in sfxge_tx_start()
2725 sfxge_tx_stop(sp); in sfxge_tx_start()
2746 sfxge_tx_packet_add(sfxge_t *sp, mblk_t *mp) in sfxge_tx_packet_add() argument
2774 if (sp->s_state != SFXGE_STARTED) { in sfxge_tx_packet_add()
2811 sfxge_rx_scale_t *srsp = &(sp->s_rx_scale); in sfxge_tx_packet_add()
2829 SFXGE_TCP_HASH(sp, in sfxge_tx_packet_add()
2843 SFXGE_IP_HASH(sp, in sfxge_tx_packet_add()
2870 txq = sp->s_tx_scale_base[SFXGE_TXQ_IP_TCP_UDP_CKSUM] + in sfxge_tx_packet_add()
2872 stp = sp->s_stp[txq]; in sfxge_tx_packet_add()
2876 txq = sp->s_tx_scale_base[SFXGE_TXQ_IP_TCP_UDP_CKSUM] + in sfxge_tx_packet_add()
2878 stp = sp->s_stp[txq]; in sfxge_tx_packet_add()
2881 ASSERT3U(sp->s_tx_scale_max[SFXGE_TXQ_IP_CKSUM], >=, 1); in sfxge_tx_packet_add()
2883 txq = sp->s_tx_scale_base[SFXGE_TXQ_IP_CKSUM] + index; in sfxge_tx_packet_add()
2884 stp = sp->s_stp[txq]; in sfxge_tx_packet_add()
2889 sfxge_rx_scale_t *srsp = &(sp->s_rx_scale); in sfxge_tx_packet_add()
2907 SFXGE_IP_HASH(sp, in sfxge_tx_packet_add()
2921 ASSERT3U(sp->s_tx_scale_max[SFXGE_TXQ_NON_CKSUM], in sfxge_tx_packet_add()
2923 txq = sp->s_tx_scale_base[SFXGE_TXQ_NON_CKSUM] + index; in sfxge_tx_packet_add()
2924 stp = sp->s_stp[txq]; in sfxge_tx_packet_add()
2927 ASSERT3U(sp->s_tx_scale_max[SFXGE_TXQ_NON_CKSUM], >, 0); in sfxge_tx_packet_add()
2929 txq = sp->s_tx_scale_base[SFXGE_TXQ_NON_CKSUM] + index; in sfxge_tx_packet_add()
2930 stp = sp->s_stp[txq]; in sfxge_tx_packet_add()
2954 if ((stpp = sfxge_tx_packet_create(sp)) == NULL) { in sfxge_tx_packet_add()
2999 sfxge_tx_packet_destroy(sp, stpp); in sfxge_tx_packet_add()
3015 sfxge_tx_stop(sfxge_t *sp) in sfxge_tx_stop() argument
3017 efx_nic_t *enp = sp->s_enp; in sfxge_tx_stop()
3022 ASSERT(mutex_owned(&(sp->s_state_lock))); in sfxge_tx_stop()
3024 mutex_enter(&(sp->s_tx_flush_lock)); in sfxge_tx_stop()
3027 if (sp->s_hw_err == SFXGE_HW_OK) { in sfxge_tx_stop()
3038 index = EFX_ARRAY_SIZE(sp->s_stp); in sfxge_tx_stop()
3040 if (sp->s_stp[index] != NULL) in sfxge_tx_stop()
3041 sfxge_tx_qflush(sp, index, wait_for_flush); in sfxge_tx_stop()
3050 while (sp->s_tx_flush_pending > 0) { in sfxge_tx_stop()
3051 if (cv_timedwait(&(sp->s_tx_flush_kv), &(sp->s_tx_flush_lock), in sfxge_tx_stop()
3054 dev_info_t *dip = sp->s_dip; in sfxge_tx_stop()
3064 sp->s_tx_flush_pending = 0; in sfxge_tx_stop()
3065 mutex_exit(&(sp->s_tx_flush_lock)); in sfxge_tx_stop()
3068 index = EFX_ARRAY_SIZE(sp->s_stp); in sfxge_tx_stop()
3070 if (sp->s_stp[index] != NULL) in sfxge_tx_stop()
3071 sfxge_tx_qstop(sp, index); in sfxge_tx_stop()
3079 sfxge_tx_fini(sfxge_t *sp) in sfxge_tx_fini() argument
3083 index = EFX_ARRAY_SIZE(sp->s_stp); in sfxge_tx_fini()
3085 if (sp->s_stp[index] != NULL) in sfxge_tx_fini()
3086 sfxge_tx_qfini(sp, index); in sfxge_tx_fini()
3089 kmem_cache_destroy(sp->s_tqc); in sfxge_tx_fini()
3090 sp->s_tqc = NULL; in sfxge_tx_fini()
3092 kmem_cache_destroy(sp->s_tmc); in sfxge_tx_fini()
3093 sp->s_tmc = NULL; in sfxge_tx_fini()
3095 kmem_cache_destroy(sp->s_tbc); in sfxge_tx_fini()
3096 sp->s_tbc = NULL; in sfxge_tx_fini()
3098 kmem_cache_destroy(sp->s_tpc); in sfxge_tx_fini()
3099 sp->s_tpc = NULL; in sfxge_tx_fini()