Lines Matching refs:pool

79 #define IS_TX_DESC_POOL_STATUS_INACTIVE(pool) \  argument
80 ((pool)->status == FLOW_POOL_INACTIVE)
102 #define IS_TX_DESC_POOL_STATUS_INACTIVE(pool) (false) argument
507 struct dp_tx_desc_s *dp_tx_get_desc_flow_pool(struct dp_tx_desc_pool_s *pool) in dp_tx_get_desc_flow_pool() argument
509 struct dp_tx_desc_s *tx_desc = pool->freelist; in dp_tx_get_desc_flow_pool()
511 pool->freelist = pool->freelist->next; in dp_tx_get_desc_flow_pool()
512 pool->avail_desc--; in dp_tx_get_desc_flow_pool()
526 void dp_tx_put_desc_flow_pool(struct dp_tx_desc_pool_s *pool, in dp_tx_put_desc_flow_pool() argument
529 tx_desc->next = pool->freelist; in dp_tx_put_desc_flow_pool()
530 pool->freelist = tx_desc; in dp_tx_put_desc_flow_pool()
531 pool->avail_desc++; in dp_tx_put_desc_flow_pool()
535 dp_tx_desc_free_list(struct dp_tx_desc_pool_s *pool, in dp_tx_desc_free_list() argument
551 dp_tx_flow_pool_member_clean(struct dp_tx_desc_pool_s *pool) in dp_tx_flow_pool_member_clean() argument
553 pool->elem_size = 0; in dp_tx_flow_pool_member_clean()
554 pool->freelist = NULL; in dp_tx_flow_pool_member_clean()
555 pool->pool_size = 0; in dp_tx_flow_pool_member_clean()
556 pool->avail_desc = 0; in dp_tx_flow_pool_member_clean()
557 qdf_mem_zero(pool->start_th, FL_TH_MAX); in dp_tx_flow_pool_member_clean()
558 qdf_mem_zero(pool->stop_th, FL_TH_MAX); in dp_tx_flow_pool_member_clean()
559 pool->status = FLOW_POOL_INACTIVE; in dp_tx_flow_pool_member_clean()
570 dp_tx_is_threshold_reached(struct dp_tx_desc_pool_s *pool, uint16_t avail_desc) in dp_tx_is_threshold_reached() argument
572 if (qdf_unlikely(avail_desc == pool->stop_th[DP_TH_BE_BK])) in dp_tx_is_threshold_reached()
574 else if (qdf_unlikely(avail_desc == pool->stop_th[DP_TH_VI])) in dp_tx_is_threshold_reached()
576 else if (qdf_unlikely(avail_desc == pool->stop_th[DP_TH_VO])) in dp_tx_is_threshold_reached()
578 else if (qdf_unlikely(avail_desc == pool->stop_th[DP_TH_HI])) in dp_tx_is_threshold_reached()
591 struct dp_tx_desc_pool_s *pool) in dp_tx_adjust_flow_pool_state() argument
593 if (pool->avail_desc > pool->stop_th[DP_TH_BE_BK]) { in dp_tx_adjust_flow_pool_state()
594 pool->status = FLOW_POOL_ACTIVE_UNPAUSED; in dp_tx_adjust_flow_pool_state()
596 } else if (pool->avail_desc <= pool->stop_th[DP_TH_BE_BK] && in dp_tx_adjust_flow_pool_state()
597 pool->avail_desc > pool->stop_th[DP_TH_VI]) { in dp_tx_adjust_flow_pool_state()
598 pool->status = FLOW_POOL_BE_BK_PAUSED; in dp_tx_adjust_flow_pool_state()
599 } else if (pool->avail_desc <= pool->stop_th[DP_TH_VI] && in dp_tx_adjust_flow_pool_state()
600 pool->avail_desc > pool->stop_th[DP_TH_VO]) { in dp_tx_adjust_flow_pool_state()
601 pool->status = FLOW_POOL_VI_PAUSED; in dp_tx_adjust_flow_pool_state()
602 } else if (pool->avail_desc <= pool->stop_th[DP_TH_VO] && in dp_tx_adjust_flow_pool_state()
603 pool->avail_desc > pool->stop_th[DP_TH_HI]) { in dp_tx_adjust_flow_pool_state()
604 pool->status = FLOW_POOL_VO_PAUSED; in dp_tx_adjust_flow_pool_state()
605 } else if (pool->avail_desc <= pool->stop_th[DP_TH_HI]) { in dp_tx_adjust_flow_pool_state()
606 pool->status = FLOW_POOL_ACTIVE_PAUSED; in dp_tx_adjust_flow_pool_state()
609 switch (pool->status) { in dp_tx_adjust_flow_pool_state()
611 soc->pause_cb(pool->flow_pool_id, in dp_tx_adjust_flow_pool_state()
617 soc->pause_cb(pool->flow_pool_id, in dp_tx_adjust_flow_pool_state()
623 soc->pause_cb(pool->flow_pool_id, in dp_tx_adjust_flow_pool_state()
629 soc->pause_cb(pool->flow_pool_id, in dp_tx_adjust_flow_pool_state()
634 dp_err("Invalid pool status:%u to adjust", pool->status); in dp_tx_adjust_flow_pool_state()
649 struct dp_tx_desc_pool_s *pool = &soc->tx_desc[desc_pool_id]; in dp_tx_desc_alloc() local
655 if (qdf_likely(pool)) { in dp_tx_desc_alloc()
656 qdf_spin_lock_bh(&pool->flow_pool_lock); in dp_tx_desc_alloc()
657 if (qdf_likely(pool->avail_desc && in dp_tx_desc_alloc()
658 pool->status != FLOW_POOL_INVALID && in dp_tx_desc_alloc()
659 pool->status != FLOW_POOL_INACTIVE)) { in dp_tx_desc_alloc()
660 tx_desc = dp_tx_get_desc_flow_pool(pool); in dp_tx_desc_alloc()
665 is_pause = dp_tx_is_threshold_reached(pool, in dp_tx_desc_alloc()
666 pool->avail_desc); in dp_tx_desc_alloc()
668 if (qdf_unlikely(pool->status == in dp_tx_desc_alloc()
670 dp_tx_adjust_flow_pool_state(soc, pool); in dp_tx_desc_alloc()
675 switch (pool->status) { in dp_tx_desc_alloc()
681 pool->status = FLOW_POOL_BE_BK_PAUSED; in dp_tx_desc_alloc()
688 pool->status = FLOW_POOL_VI_PAUSED; in dp_tx_desc_alloc()
695 pool->status = FLOW_POOL_VO_PAUSED; in dp_tx_desc_alloc()
702 pool->status = FLOW_POOL_ACTIVE_PAUSED; in dp_tx_desc_alloc()
709 pool->status); in dp_tx_desc_alloc()
714 pool->latest_pause_time[level] = in dp_tx_desc_alloc()
722 pool->pkt_drop_no_desc++; in dp_tx_desc_alloc()
724 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_alloc()
745 struct dp_tx_desc_pool_s *pool = &soc->tx_desc[desc_pool_id]; in dp_tx_desc_free() local
750 qdf_spin_lock_bh(&pool->flow_pool_lock); in dp_tx_desc_free()
755 dp_tx_put_desc_flow_pool(pool, tx_desc); in dp_tx_desc_free()
756 switch (pool->status) { in dp_tx_desc_free()
758 if (pool->avail_desc > pool->start_th[DP_TH_HI]) { in dp_tx_desc_free()
761 pool->status = FLOW_POOL_VO_PAUSED; in dp_tx_desc_free()
765 pool->latest_pause_time[DP_TH_HI]; in dp_tx_desc_free()
766 if (pool->max_pause_time[DP_TH_HI] < pause_dur) in dp_tx_desc_free()
767 pool->max_pause_time[DP_TH_HI] = pause_dur; in dp_tx_desc_free()
771 if (pool->avail_desc > pool->start_th[DP_TH_VO]) { in dp_tx_desc_free()
774 pool->status = FLOW_POOL_VI_PAUSED; in dp_tx_desc_free()
778 pool->latest_pause_time[DP_TH_VO]; in dp_tx_desc_free()
779 if (pool->max_pause_time[DP_TH_VO] < pause_dur) in dp_tx_desc_free()
780 pool->max_pause_time[DP_TH_VO] = pause_dur; in dp_tx_desc_free()
784 if (pool->avail_desc > pool->start_th[DP_TH_VI]) { in dp_tx_desc_free()
787 pool->status = FLOW_POOL_BE_BK_PAUSED; in dp_tx_desc_free()
791 pool->latest_pause_time[DP_TH_VI]; in dp_tx_desc_free()
792 if (pool->max_pause_time[DP_TH_VI] < pause_dur) in dp_tx_desc_free()
793 pool->max_pause_time[DP_TH_VI] = pause_dur; in dp_tx_desc_free()
797 if (pool->avail_desc > pool->start_th[DP_TH_BE_BK]) { in dp_tx_desc_free()
800 pool->status = FLOW_POOL_ACTIVE_UNPAUSED; in dp_tx_desc_free()
804 pool->latest_pause_time[DP_TH_BE_BK]; in dp_tx_desc_free()
805 if (pool->max_pause_time[DP_TH_BE_BK] < pause_dur) in dp_tx_desc_free()
806 pool->max_pause_time[DP_TH_BE_BK] = pause_dur; in dp_tx_desc_free()
810 if (pool->avail_desc == pool->pool_size) { in dp_tx_desc_free()
813 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_free()
826 desc_pool_id, pool->status); in dp_tx_desc_free()
831 soc->pause_cb(pool->flow_pool_id, in dp_tx_desc_free()
833 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_free()
850 dp_tx_is_threshold_reached(struct dp_tx_desc_pool_s *pool, uint16_t avail_desc) in dp_tx_is_threshold_reached() argument
852 if (qdf_unlikely(avail_desc < pool->stop_th)) in dp_tx_is_threshold_reached()
869 struct dp_tx_desc_pool_s *pool = &soc->tx_desc[desc_pool_id]; in dp_tx_desc_alloc() local
871 if (pool) { in dp_tx_desc_alloc()
872 qdf_spin_lock_bh(&pool->flow_pool_lock); in dp_tx_desc_alloc()
873 if (pool->status <= FLOW_POOL_ACTIVE_PAUSED && in dp_tx_desc_alloc()
874 pool->avail_desc) { in dp_tx_desc_alloc()
875 tx_desc = dp_tx_get_desc_flow_pool(pool); in dp_tx_desc_alloc()
880 if (qdf_unlikely(pool->avail_desc < pool->stop_th)) { in dp_tx_desc_alloc()
881 pool->status = FLOW_POOL_ACTIVE_PAUSED; in dp_tx_desc_alloc()
882 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_alloc()
888 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_alloc()
891 pool->pkt_drop_no_desc++; in dp_tx_desc_alloc()
892 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_alloc()
918 struct dp_tx_desc_pool_s *pool = &soc->tx_desc[desc_pool_id]; in dp_tx_desc_free() local
920 qdf_spin_lock_bh(&pool->flow_pool_lock); in dp_tx_desc_free()
925 dp_tx_put_desc_flow_pool(pool, tx_desc); in dp_tx_desc_free()
926 switch (pool->status) { in dp_tx_desc_free()
928 if (pool->avail_desc > pool->start_th) { in dp_tx_desc_free()
929 soc->pause_cb(pool->flow_pool_id, in dp_tx_desc_free()
932 pool->status = FLOW_POOL_ACTIVE_UNPAUSED; in dp_tx_desc_free()
936 if (pool->avail_desc == pool->pool_size) { in dp_tx_desc_free()
939 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_free()
954 qdf_spin_unlock_bh(&pool->flow_pool_lock); in dp_tx_desc_free()
970 struct dp_tx_desc_pool_s *pool; in dp_tx_desc_thresh_reached() local
976 pool = vdev->pool; in dp_tx_desc_thresh_reached()
977 status = dp_tx_is_threshold_reached(pool, pool->avail_desc); in dp_tx_desc_thresh_reached()
1029 struct dp_tx_desc_pool_s *pool = NULL; in dp_tx_desc_alloc() local
1031 pool = dp_get_tx_desc_pool(soc, desc_pool_id); in dp_tx_desc_alloc()
1033 TX_DESC_LOCK_LOCK(&pool->lock); in dp_tx_desc_alloc()
1035 tx_desc = pool->freelist; in dp_tx_desc_alloc()
1039 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_desc_alloc()
1043 pool->freelist = pool->freelist->next; in dp_tx_desc_alloc()
1044 pool->num_allocated++; in dp_tx_desc_alloc()
1045 pool->num_free--; in dp_tx_desc_alloc()
1046 dp_tx_prefetch_desc(pool->freelist); in dp_tx_desc_alloc()
1050 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_desc_alloc()
1059 struct dp_tx_desc_pool_s *pool = NULL; in dp_tx_spcl_desc_alloc() local
1061 pool = dp_get_spcl_tx_desc_pool(soc, desc_pool_id); in dp_tx_spcl_desc_alloc()
1063 TX_DESC_LOCK_LOCK(&pool->lock); in dp_tx_spcl_desc_alloc()
1065 tx_desc = pool->freelist; in dp_tx_spcl_desc_alloc()
1069 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_spcl_desc_alloc()
1073 pool->freelist = pool->freelist->next; in dp_tx_spcl_desc_alloc()
1074 pool->num_allocated++; in dp_tx_spcl_desc_alloc()
1075 pool->num_free--; in dp_tx_spcl_desc_alloc()
1076 dp_tx_prefetch_desc(pool->freelist); in dp_tx_spcl_desc_alloc()
1081 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_spcl_desc_alloc()
1102 struct dp_tx_desc_pool_s *pool = NULL; in dp_tx_desc_alloc_multiple() local
1104 pool = dp_get_tx_desc_pool(soc, desc_pool_id); in dp_tx_desc_alloc_multiple()
1106 TX_DESC_LOCK_LOCK(&pool->lock); in dp_tx_desc_alloc_multiple()
1109 (pool->num_free < num_requested)) { in dp_tx_desc_alloc_multiple()
1110 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_desc_alloc_multiple()
1113 __func__, pool->num_free, in dp_tx_desc_alloc_multiple()
1118 h_desc = pool->freelist; in dp_tx_desc_alloc_multiple()
1128 pool->num_free -= count; in dp_tx_desc_alloc_multiple()
1129 pool->num_allocated += count; in dp_tx_desc_alloc_multiple()
1130 pool->freelist = c_desc->next; in dp_tx_desc_alloc_multiple()
1133 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_desc_alloc_multiple()
1147 struct dp_tx_desc_pool_s *pool = NULL; in dp_tx_desc_free() local
1150 pool = dp_get_tx_desc_pool(soc, desc_pool_id); in dp_tx_desc_free()
1151 TX_DESC_LOCK_LOCK(&pool->lock); in dp_tx_desc_free()
1152 tx_desc->next = pool->freelist; in dp_tx_desc_free()
1153 pool->freelist = tx_desc; in dp_tx_desc_free()
1154 pool->num_allocated--; in dp_tx_desc_free()
1155 pool->num_free++; in dp_tx_desc_free()
1156 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_desc_free()
1163 struct dp_tx_desc_pool_s *pool = NULL; in dp_tx_spcl_desc_free() local
1167 pool = dp_get_spcl_tx_desc_pool(soc, desc_pool_id); in dp_tx_spcl_desc_free()
1168 TX_DESC_LOCK_LOCK(&pool->lock); in dp_tx_spcl_desc_free()
1169 tx_desc->next = pool->freelist; in dp_tx_spcl_desc_free()
1170 pool->freelist = tx_desc; in dp_tx_spcl_desc_free()
1171 pool->num_allocated--; in dp_tx_spcl_desc_free()
1172 pool->num_free++; in dp_tx_spcl_desc_free()
1173 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_spcl_desc_free()
1177 dp_tx_desc_free_list(struct dp_tx_desc_pool_s *pool, in dp_tx_desc_free_list() argument
1182 TX_DESC_LOCK_LOCK(&pool->lock); in dp_tx_desc_free_list()
1183 pool->num_allocated -= fast_desc_count; in dp_tx_desc_free_list()
1184 pool->num_free += fast_desc_count; in dp_tx_desc_free_list()
1185 tail_desc->next = pool->freelist; in dp_tx_desc_free_list()
1186 pool->freelist = head_desc; in dp_tx_desc_free_list()
1187 TX_DESC_LOCK_UNLOCK(&pool->lock); in dp_tx_desc_free_list()
1205 struct dp_tx_desc_pool_s *pool; in dp_tx_is_desc_id_valid() local
1220 pool = &soc->tx_desc[pool_id]; in dp_tx_is_desc_id_valid()
1222 if (IS_TX_DESC_POOL_STATUS_INACTIVE(pool)) { in dp_tx_is_desc_id_valid()
1234 if (page_id >= pool->desc_pages.num_pages) { in dp_tx_is_desc_id_valid()
1241 pool->desc_pages.num_pages); in dp_tx_is_desc_id_valid()
1248 if (offset >= pool->desc_pages.num_element_per_page) { in dp_tx_is_desc_id_valid()
1255 pool->desc_pages.num_element_per_page); in dp_tx_is_desc_id_valid()