Lines Matching refs:p_spq

148 				  struct qed_spq *p_spq)  in qed_spq_hw_initialize()  argument
156 cxt_info.iid = p_spq->cid; in qed_spq_hw_initialize()
162 p_spq->cid); in qed_spq_hw_initialize()
182 DMA_LO_LE(p_spq->chain.p_phys_addr); in qed_spq_hw_initialize()
184 DMA_HI_LE(p_spq->chain.p_phys_addr); in qed_spq_hw_initialize()
193 struct qed_spq *p_spq, in qed_spq_hw_post() argument
196 struct qed_chain *p_chain = &p_hwfn->p_spq->chain; in qed_spq_hw_post()
226 DOORBELL(p_hwfn, qed_db_addr(p_spq->cid, DQ_DEMS_LEGACY), *(u32 *)&db); in qed_spq_hw_post()
233 qed_db_addr(p_spq->cid, DQ_DEMS_LEGACY), in qed_spq_hw_post()
234 p_spq->cid, db.params, db.agg_flags, in qed_spq_hw_post()
410 struct qed_spq *p_spq = p_hwfn->p_spq; in qed_spq_setup() local
415 INIT_LIST_HEAD(&p_spq->pending); in qed_spq_setup()
416 INIT_LIST_HEAD(&p_spq->completion_pending); in qed_spq_setup()
417 INIT_LIST_HEAD(&p_spq->free_pool); in qed_spq_setup()
418 INIT_LIST_HEAD(&p_spq->unlimited_pending); in qed_spq_setup()
419 spin_lock_init(&p_spq->lock); in qed_spq_setup()
422 p_phys = p_spq->p_phys + offsetof(struct qed_spq_entry, ramrod); in qed_spq_setup()
423 p_virt = p_spq->p_virt; in qed_spq_setup()
425 for (i = 0; i < p_spq->chain.capacity; i++) { in qed_spq_setup()
429 list_add_tail(&p_virt->list, &p_spq->free_pool); in qed_spq_setup()
436 p_spq->normal_count = 0; in qed_spq_setup()
437 p_spq->comp_count = 0; in qed_spq_setup()
438 p_spq->comp_sent_count = 0; in qed_spq_setup()
439 p_spq->unlimited_pending_count = 0; in qed_spq_setup()
441 bitmap_zero(p_spq->p_comp_bitmap, SPQ_RING_SIZE); in qed_spq_setup()
442 p_spq->comp_bitmap_idx = 0; in qed_spq_setup()
445 qed_cxt_acquire_cid(p_hwfn, PROTOCOLID_CORE, &p_spq->cid); in qed_spq_setup()
446 qed_spq_hw_initialize(p_hwfn, p_spq); in qed_spq_setup()
449 qed_chain_reset(&p_spq->chain); in qed_spq_setup()
454 struct qed_spq *p_spq = NULL; in qed_spq_alloc() local
459 p_spq = in qed_spq_alloc()
461 if (!p_spq) { in qed_spq_alloc()
472 &p_spq->chain)) { in qed_spq_alloc()
479 p_spq->chain.capacity * in qed_spq_alloc()
487 p_spq->p_virt = p_virt; in qed_spq_alloc()
488 p_spq->p_phys = p_phys; in qed_spq_alloc()
489 p_hwfn->p_spq = p_spq; in qed_spq_alloc()
494 qed_chain_free(p_hwfn->cdev, &p_spq->chain); in qed_spq_alloc()
495 kfree(p_spq); in qed_spq_alloc()
501 struct qed_spq *p_spq = p_hwfn->p_spq; in qed_spq_free() local
503 if (!p_spq) in qed_spq_free()
506 if (p_spq->p_virt) in qed_spq_free()
508 p_spq->chain.capacity * in qed_spq_free()
510 p_spq->p_virt, in qed_spq_free()
511 p_spq->p_phys); in qed_spq_free()
513 qed_chain_free(p_hwfn->cdev, &p_spq->chain); in qed_spq_free()
515 kfree(p_spq); in qed_spq_free()
522 struct qed_spq *p_spq = p_hwfn->p_spq; in qed_spq_get_entry() local
526 spin_lock_bh(&p_spq->lock); in qed_spq_get_entry()
528 if (list_empty(&p_spq->free_pool)) { in qed_spq_get_entry()
534 p_ent->queue = &p_spq->unlimited_pending; in qed_spq_get_entry()
536 p_ent = list_first_entry(&p_spq->free_pool, in qed_spq_get_entry()
540 p_ent->queue = &p_spq->pending; in qed_spq_get_entry()
546 spin_unlock_bh(&p_spq->lock); in qed_spq_get_entry()
554 list_add_tail(&p_ent->list, &p_hwfn->p_spq->free_pool); in __qed_spq_return_entry()
560 spin_lock_bh(&p_hwfn->p_spq->lock); in qed_spq_return_entry()
562 spin_unlock_bh(&p_hwfn->p_spq->lock); in qed_spq_return_entry()
584 struct qed_spq *p_spq = p_hwfn->p_spq; in qed_spq_add_entry() local
586 if (p_ent->queue == &p_spq->unlimited_pending) { in qed_spq_add_entry()
588 if (list_empty(&p_spq->free_pool)) { in qed_spq_add_entry()
589 list_add_tail(&p_ent->list, &p_spq->unlimited_pending); in qed_spq_add_entry()
590 p_spq->unlimited_pending_count++; in qed_spq_add_entry()
596 p_en2 = list_first_entry(&p_spq->free_pool, in qed_spq_add_entry()
618 list_add_tail(&p_ent->list, &p_spq->pending); in qed_spq_add_entry()
619 p_spq->normal_count++; in qed_spq_add_entry()
622 list_add(&p_ent->list, &p_spq->pending); in qed_spq_add_entry()
623 p_spq->high_count++; in qed_spq_add_entry()
637 if (!p_hwfn->p_spq) in qed_spq_get_cid()
639 return p_hwfn->p_spq->cid; in qed_spq_get_cid()
649 struct qed_spq *p_spq = p_hwfn->p_spq; in qed_spq_post_list() local
652 while (qed_chain_get_elem_left(&p_spq->chain) > keep_reserve && in qed_spq_post_list()
657 list_add_tail(&p_ent->list, &p_spq->completion_pending); in qed_spq_post_list()
658 p_spq->comp_sent_count++; in qed_spq_post_list()
660 rc = qed_spq_hw_post(p_hwfn, p_spq, p_ent); in qed_spq_post_list()
673 struct qed_spq *p_spq = p_hwfn->p_spq; in qed_spq_pend_post() local
676 while (!list_empty(&p_spq->free_pool)) { in qed_spq_pend_post()
677 if (list_empty(&p_spq->unlimited_pending)) in qed_spq_pend_post()
680 p_ent = list_first_entry(&p_spq->unlimited_pending, in qed_spq_pend_post()
691 return qed_spq_post_list(p_hwfn, &p_spq->pending, in qed_spq_pend_post()
700 struct qed_spq *p_spq = p_hwfn ? p_hwfn->p_spq : NULL; in qed_spq_post() local
714 spin_lock_bh(&p_spq->lock); in qed_spq_post()
735 spin_unlock_bh(&p_spq->lock); in qed_spq_post()
753 spin_lock_bh(&p_spq->lock); in qed_spq_post()
755 qed_chain_return_produced(&p_spq->chain); in qed_spq_post()
761 spin_unlock_bh(&p_spq->lock); in qed_spq_post()
771 struct qed_spq *p_spq; in qed_spq_completion() local
780 p_spq = p_hwfn->p_spq; in qed_spq_completion()
781 if (!p_spq) in qed_spq_completion()
784 spin_lock_bh(&p_spq->lock); in qed_spq_completion()
785 list_for_each_entry_safe(p_ent, tmp, &p_spq->completion_pending, in qed_spq_completion()
797 bitmap_set(p_spq->p_comp_bitmap, pos, SPQ_RING_SIZE); in qed_spq_completion()
799 while (test_bit(p_spq->comp_bitmap_idx, in qed_spq_completion()
800 p_spq->p_comp_bitmap)) { in qed_spq_completion()
801 bitmap_clear(p_spq->p_comp_bitmap, in qed_spq_completion()
802 p_spq->comp_bitmap_idx, in qed_spq_completion()
804 p_spq->comp_bitmap_idx++; in qed_spq_completion()
805 qed_chain_return_produced(&p_spq->chain); in qed_spq_completion()
808 p_spq->comp_count++; in qed_spq_completion()
825 spin_unlock_bh(&p_spq->lock); in qed_spq_completion()
844 spin_lock_bh(&p_spq->lock); in qed_spq_completion()
846 spin_unlock_bh(&p_spq->lock); in qed_spq_completion()