p_spq
struct ecore_spq *p_spq;
n_eqes = ecore_chain_get_capacity(&p_hwfn->p_spq->chain);
OSAL_SPIN_LOCK(&p_spq->lock);
OSAL_LIST_REMOVE_ENTRY(&p_ent->list, &p_spq->completion_pending);
ecore_chain_return_produced(&p_spq->chain);
OSAL_SPIN_UNLOCK(&p_spq->lock);
struct ecore_spq *p_spq;
p_spq = p_hwfn->p_spq;
if (!p_spq) {
OSAL_SPIN_LOCK(&p_spq->lock);
&p_spq->completion_pending,
&p_spq->completion_pending);
SPQ_COMP_BMAP_SET_BIT(p_spq, echo);
while (SPQ_COMP_BMAP_TEST_BIT(p_spq,
p_spq->comp_bitmap_idx)) {
SPQ_COMP_BMAP_CLEAR_BIT(p_spq,
p_spq->comp_bitmap_idx);
p_spq->comp_bitmap_idx++;
ecore_chain_return_produced(&p_spq->chain);
p_spq->comp_count++;
OSAL_SPIN_UNLOCK(&p_spq->lock);
(found->queue == &p_spq->unlimited_pending))
struct ecore_spq *p_spq)
cxt_info.iid = p_spq->cid;
p_spq->cid);
DMA_LO_LE(p_spq->chain.p_phys_addr);
DMA_HI_LE(p_spq->chain.p_phys_addr);
struct ecore_spq *p_spq,
struct ecore_chain *p_chain = &p_hwfn->p_spq->chain;
struct core_db_data *p_db_data = &p_spq->db_data;
DOORBELL(p_hwfn, p_spq->db_addr_offset, *(u32 *)p_db_data);
p_spq->db_addr_offset, p_spq->cid, p_db_data->params,
if (!p_hwfn->p_spq || (p_eqe->protocol_id >= MAX_PROTOCOL_TYPE)) {
cb = p_hwfn->p_spq->async_comp_cb[p_eqe->protocol_id];
if (!p_hwfn->p_spq || (protocol_id >= MAX_PROTOCOL_TYPE)) {
p_hwfn->p_spq->async_comp_cb[protocol_id] = cb;
if (!p_hwfn->p_spq || (protocol_id >= MAX_PROTOCOL_TYPE)) {
p_hwfn->p_spq->async_comp_cb[protocol_id] = OSAL_NULL;
OSAL_SPIN_LOCK(&p_hwfn->p_spq->lock);
OSAL_SPIN_UNLOCK(&p_hwfn->p_spq->lock);
struct ecore_spq *p_spq = p_hwfn->p_spq;
OSAL_LIST_INIT(&p_spq->pending);
OSAL_LIST_INIT(&p_spq->completion_pending);
OSAL_LIST_INIT(&p_spq->free_pool);
OSAL_LIST_INIT(&p_spq->unlimited_pending);
OSAL_SPIN_LOCK_INIT(&p_spq->lock);
p_phys = p_spq->p_phys + OFFSETOF(struct ecore_spq_entry, ramrod);
p_virt = p_spq->p_virt;
capacity = ecore_chain_get_capacity(&p_spq->chain);
OSAL_LIST_PUSH_TAIL(&p_virt->list, &p_spq->free_pool);
p_spq->normal_count = 0;
p_spq->comp_count = 0;
p_spq->comp_sent_count = 0;
p_spq->unlimited_pending_count = 0;
OSAL_MEM_ZERO(p_spq->p_comp_bitmap,
p_spq->comp_bitmap_idx = 0;
ecore_cxt_acquire_cid(p_hwfn, PROTOCOLID_CORE, &p_spq->cid);
ecore_spq_hw_initialize(p_hwfn, p_spq);
ecore_chain_reset(&p_spq->chain);
p_spq->db_addr_offset = DB_ADDR(p_spq->cid, DQ_DEMS_LEGACY);
p_db_data = &p_spq->db_data;
db_addr = (void *)((u8 *)p_hwfn->doorbells + p_spq->db_addr_offset);
rc = ecore_db_recovery_add(p_hwfn->p_dev, db_addr, &p_spq->db_data,
struct ecore_spq *p_spq = OSAL_NULL;
p_spq =
if (!p_spq) {
&p_spq->chain, OSAL_NULL)) {
capacity = ecore_chain_get_capacity(&p_spq->chain);
p_spq->p_virt = p_virt;
p_spq->p_phys = p_phys;
if (OSAL_SPIN_LOCK_ALLOC(p_hwfn, &p_spq->lock))
p_hwfn->p_spq = p_spq;
ecore_chain_free(p_hwfn->p_dev, &p_spq->chain);
OSAL_FREE(p_hwfn->p_dev, p_spq);
struct ecore_spq *p_spq = p_hwfn->p_spq;
if (!p_spq)
db_addr = (void *)((u8 *)p_hwfn->doorbells + p_spq->db_addr_offset);
ecore_db_recovery_del(p_hwfn->p_dev, db_addr, &p_spq->db_data);
if (p_spq->p_virt) {
capacity = ecore_chain_get_capacity(&p_spq->chain);
p_spq->p_virt,
p_spq->p_phys,
ecore_chain_free(p_hwfn->p_dev, &p_spq->chain);
OSAL_SPIN_LOCK_DEALLOC(&p_spq->lock);
OSAL_FREE(p_hwfn->p_dev, p_spq);
p_hwfn->p_spq = OSAL_NULL;
struct ecore_spq *p_spq = p_hwfn->p_spq;
OSAL_SPIN_LOCK(&p_spq->lock);
if (OSAL_LIST_IS_EMPTY(&p_spq->free_pool)) {
p_ent->queue = &p_spq->unlimited_pending;
p_ent = OSAL_LIST_FIRST_ENTRY(&p_spq->free_pool,
OSAL_LIST_REMOVE_ENTRY(&p_ent->list, &p_spq->free_pool);
p_ent->queue = &p_spq->pending;
OSAL_SPIN_UNLOCK(&p_spq->lock);
OSAL_LIST_PUSH_TAIL(&p_ent->list, &p_hwfn->p_spq->free_pool);
OSAL_SPIN_LOCK(&p_hwfn->p_spq->lock);
OSAL_SPIN_UNLOCK(&p_hwfn->p_spq->lock);
struct ecore_spq *p_spq = p_hwfn->p_spq;
if (p_ent->queue == &p_spq->unlimited_pending) {
if (OSAL_LIST_IS_EMPTY(&p_spq->free_pool)) {
&p_spq->unlimited_pending);
p_spq->unlimited_pending_count++;
p_en2 = OSAL_LIST_FIRST_ENTRY(&p_spq->free_pool,
OSAL_LIST_REMOVE_ENTRY(&p_en2->list, &p_spq->free_pool);
OSAL_LIST_PUSH_TAIL(&p_ent->list, &p_spq->pending);
p_spq->normal_count++;
OSAL_LIST_PUSH_HEAD(&p_ent->list, &p_spq->pending);
p_spq->high_count++;
if (!p_hwfn->p_spq) {
return p_hwfn->p_spq->cid;
struct ecore_spq *p_spq = p_hwfn->p_spq;
while (ecore_chain_get_elem_left(&p_spq->chain) > keep_reserve &&
OSAL_LIST_PUSH_TAIL(&p_ent->list, &p_spq->completion_pending);
p_spq->comp_sent_count++;
rc = ecore_spq_hw_post(p_hwfn, p_spq, p_ent);
&p_spq->completion_pending);
struct ecore_spq *p_spq = p_hwfn->p_spq;
while (!OSAL_LIST_IS_EMPTY(&p_spq->free_pool))
if (OSAL_LIST_IS_EMPTY(&p_spq->unlimited_pending))
p_ent = OSAL_LIST_FIRST_ENTRY(&p_spq->unlimited_pending,
OSAL_LIST_REMOVE_ENTRY(&p_ent->list, &p_spq->unlimited_pending);
return ecore_spq_post_list(p_hwfn, &p_spq->pending,
struct ecore_spq *p_spq = p_hwfn ? p_hwfn->p_spq : OSAL_NULL;
OSAL_SPIN_LOCK(&p_spq->lock);
OSAL_SPIN_UNLOCK(&p_spq->lock);
p_ent->queue == &p_spq->unlimited_pending);
if (p_ent->queue == &p_spq->unlimited_pending) {
OSAL_SET_BIT(((idx) % SPQ_RING_SIZE), (p_spq)->p_comp_bitmap); \
OSAL_CLEAR_BIT(((idx) % SPQ_RING_SIZE), (p_spq)->p_comp_bitmap); \
(OSAL_TEST_BIT(((idx) % SPQ_RING_SIZE), (p_spq)->p_comp_bitmap))