Lines Matching full:wq

70 	hw_wq_t *wq = NULL;  in ocs_hw_init_queues()  local
100 /* Allocate class WQ pools */ in ocs_hw_init_queues()
109 /* Allocate per CPU WQ pools */ in ocs_hw_init_queues()
171 ocs_log_err(hw->os, "invalid ULP %d for WQ\n", qt->ulp); in ocs_hw_init_queues()
179 wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + qt->ulp); in ocs_hw_init_queues()
180 if (wq == NULL) { in ocs_hw_init_queues()
184 /* Place this WQ on the EQ WQ array */ in ocs_hw_init_queues()
185 if (ocs_varray_add(eq->wq_array, wq)) { in ocs_hw_init_queues()
191 /* Place this WQ on the HW class array */ in ocs_hw_init_queues()
193 if (ocs_varray_add(hw->wq_class_array[qt->class], wq)) { in ocs_hw_init_queues()
205 * Place this WQ on the per CPU list, asumming that EQs are mapped to cpu given in ocs_hw_init_queues()
208 if (ocs_varray_add(hw->wq_cpu_array[eq->instance % ocs_get_num_cpus()], wq)) { in ocs_hw_init_queues()
533 * @brief Allocate a new WQ object
535 * A new WQ object is instantiated
538 * @param entry_count number of entries in the WQ
539 * @param class WQ class
542 * @return pointer to allocated WQ object
548 hw_wq_t *wq = ocs_malloc(hw->os, sizeof(*wq), OCS_M_ZERO | OCS_M_NOWAIT); in hw_new_wq() local
550 if (wq != NULL) { in hw_new_wq()
551 wq->hw = cq->eq->hw; in hw_new_wq()
552 wq->cq = cq; in hw_new_wq()
553 wq->type = SLI_QTYPE_WQ; in hw_new_wq()
554 wq->instance = cq->eq->hw->wq_count++; in hw_new_wq()
555 wq->entry_count = entry_count; in hw_new_wq()
556 wq->queue = &hw->wq[wq->instance]; in hw_new_wq()
557 wq->ulp = ulp; in hw_new_wq()
558 wq->wqec_set_count = OCS_HW_WQEC_SET_COUNT; in hw_new_wq()
559 wq->wqec_count = wq->wqec_set_count; in hw_new_wq()
560 wq->free_count = wq->entry_count - 1; in hw_new_wq()
561 wq->class = class; in hw_new_wq()
562 ocs_list_init(&wq->pending_list, ocs_hw_wqe_t, link); in hw_new_wq()
564 if (sli_queue_alloc(&hw->sli, SLI_QTYPE_WQ, wq->queue, wq->entry_count, cq->queue, ulp)) { in hw_new_wq()
565 ocs_log_err(hw->os, "WQ allocation failure\n"); in hw_new_wq()
566 ocs_free(hw->os, wq, sizeof(*wq)); in hw_new_wq()
567 wq = NULL; in hw_new_wq()
569 hw->hw_wq[wq->instance] = wq; in hw_new_wq()
570 ocs_list_add_tail(&cq->q_list, wq); in hw_new_wq()
571 …ocs_log_debug(hw->os, "create wq[%2d] id %3d len %4d cls %d ulp %d\n", wq->instance, wq->queue->id, in hw_new_wq()
572 wq->entry_count, wq->class, wq->ulp); in hw_new_wq()
575 return wq; in hw_new_wq()
836 * @brief Free a WQ object
838 * The WQ object is freed
840 * @param wq pointer to WQ object
845 hw_del_wq(hw_wq_t *wq) in hw_del_wq() argument
847 if (wq != NULL) { in hw_del_wq()
848 ocs_list_remove(&wq->cq->q_list, wq); in hw_del_wq()
849 wq->cq->eq->hw->hw_wq[wq->instance] = NULL; in hw_del_wq()
850 ocs_free(wq->cq->eq->hw->os, wq, sizeof(*wq)); in hw_del_wq()
896 hw_wq_t *wq; in hw_queue_dump() local
910 wq = (hw_wq_t *) q; in hw_queue_dump()
911 ocs_printf(" wq[%d] id %2d\n", wq->instance, wq->queue->id); in hw_queue_dump()
957 * @brief Allocate a WQ to an IO object
959 * The next work queue index is used to assign a WQ to an IO.
961 * If wq_steering is OCS_HW_WQ_STEERING_CLASS, a WQ from io->wq_class is
964 * If wq_steering is OCS_HW_WQ_STEERING_REQUEST, then a WQ from the EQ that
967 * If wq_steering is OCS_HW_WQ_STEERING_CPU, then a WQ associated with the
973 * @return Return pointer to next WQ
979 hw_wq_t *wq = NULL; in ocs_hw_queue_next_wq() local
984 wq = ocs_varray_iter_next(hw->wq_class_array[io->wq_class]); in ocs_hw_queue_next_wq()
990 wq = ocs_varray_iter_next(eq->wq_array); in ocs_hw_queue_next_wq()
997 wq = ocs_varray_iter_next(hw->wq_cpu_array[cpuidx]); in ocs_hw_queue_next_wq()
1003 if (unlikely(wq == NULL)) { in ocs_hw_queue_next_wq()
1004 wq = hw->hw_wq[0]; in ocs_hw_queue_next_wq()
1007 return wq; in ocs_hw_queue_next_wq()
1177 {"wq", TOK_QUEUE, TOK_SUB_WQ},