View | Details | Raw Unified | Return to bug 255868
Collapse All | Expand All

(-)b/sys/dev/qlnx/qlnxe/ecore_spq.c (-12 / +13 lines)
Lines 786-799 void ecore_spq_return_entry(struct ecore_hwfn *p_hwfn, Link Here
786
 * @return enum _ecore_status_t
786
 * @return enum _ecore_status_t
787
 */
787
 */
788
static enum _ecore_status_t ecore_spq_add_entry(struct ecore_hwfn *p_hwfn,
788
static enum _ecore_status_t ecore_spq_add_entry(struct ecore_hwfn *p_hwfn,
789
						struct ecore_spq_entry *p_ent,
789
						struct ecore_spq_entry **p_ent,
790
						enum spq_priority priority)
790
						enum spq_priority priority)
791
{
791
{
792
	struct ecore_spq	*p_spq	= p_hwfn->p_spq;
792
	struct ecore_spq	*p_spq	= p_hwfn->p_spq;
793
	struct ecore_spq_entry p_en1 = *p_ent;
793
794
794
	if (p_ent->queue == &p_spq->unlimited_pending) {
795
	if (p_en1->queue == &p_spq->unlimited_pending) {
795
		if (OSAL_LIST_IS_EMPTY(&p_spq->free_pool)) {
796
		if (OSAL_LIST_IS_EMPTY(&p_spq->free_pool)) {
796
			OSAL_LIST_PUSH_TAIL(&p_ent->list,
797
			OSAL_LIST_PUSH_TAIL(&p_en1->list,
797
					    &p_spq->unlimited_pending);
798
					    &p_spq->unlimited_pending);
798
			p_spq->unlimited_pending_count++;
799
			p_spq->unlimited_pending_count++;
799
800
Lines 811-836 static enum _ecore_status_t ecore_spq_add_entry(struct ecore_hwfn *p_hwfn, Link Here
811
			 * entry, since we are about to override the entire ring
812
			 * entry, since we are about to override the entire ring
812
			 * entry and don't want to lose the pointer.
813
			 * entry and don't want to lose the pointer.
813
			 */
814
			 */
814
			p_ent->elem.data_ptr = p_en2->elem.data_ptr;
815
			p_en1->elem.data_ptr = p_en2->elem.data_ptr;
815
816
816
			*p_en2 = *p_ent;
817
			*p_en2 = *p_en1;
817
818
818
			/* EBLOCK responsible to free the allocated p_ent */
819
			/* EBLOCK responsible to free the allocated p_ent */
819
			if (p_ent->comp_mode != ECORE_SPQ_MODE_EBLOCK)
820
			if (p_en1->comp_mode != ECORE_SPQ_MODE_EBLOCK)
820
				OSAL_FREE(p_hwfn->p_dev, p_ent);
821
				OSAL_FREE(p_hwfn->p_dev, p_en1);
821
822
822
			p_ent = p_en2;
823
			*p_ent = p_en2;
823
		}
824
		}
824
	}
825
	}
825
826
826
	/* entry is to be placed in 'pending' queue */
827
	/* entry is to be placed in 'pending' queue */
827
	switch (priority) {
828
	switch (priority) {
828
	case ECORE_SPQ_PRIORITY_NORMAL:
829
	case ECORE_SPQ_PRIORITY_NORMAL:
829
		OSAL_LIST_PUSH_TAIL(&p_ent->list, &p_spq->pending);
830
		OSAL_LIST_PUSH_TAIL(&p_en1->list, &p_spq->pending);
830
		p_spq->normal_count++;
831
		p_spq->normal_count++;
831
		break;
832
		break;
832
	case ECORE_SPQ_PRIORITY_HIGH:
833
	case ECORE_SPQ_PRIORITY_HIGH:
833
		OSAL_LIST_PUSH_HEAD(&p_ent->list, &p_spq->pending);
834
		OSAL_LIST_PUSH_HEAD(&p_en1->list, &p_spq->pending);
834
		p_spq->high_count++;
835
		p_spq->high_count++;
835
		break;
836
		break;
836
	default:
837
	default:
Lines 913-919 enum _ecore_status_t ecore_spq_pend_post(struct ecore_hwfn *p_hwfn) Link Here
913
#endif
914
#endif
914
		OSAL_LIST_REMOVE_ENTRY(&p_ent->list, &p_spq->unlimited_pending);
915
		OSAL_LIST_REMOVE_ENTRY(&p_ent->list, &p_spq->unlimited_pending);
915
916
916
		ecore_spq_add_entry(p_hwfn, p_ent, p_ent->priority);
917
		ecore_spq_add_entry(p_hwfn, &p_ent, p_ent->priority);
917
	}
918
	}
918
919
919
	return ecore_spq_post_list(p_hwfn, &p_spq->pending,
920
	return ecore_spq_post_list(p_hwfn, &p_spq->pending,
Lines 956-962 enum _ecore_status_t ecore_spq_post(struct ecore_hwfn *p_hwfn, Link Here
956
		goto spq_post_fail;
957
		goto spq_post_fail;
957
958
958
	/* Add the request to the pending queue */
959
	/* Add the request to the pending queue */
959
	rc = ecore_spq_add_entry(p_hwfn, p_ent, p_ent->priority);
960
	rc = ecore_spq_add_entry(p_hwfn, &p_ent, p_ent->priority);
960
	if (rc)
961
	if (rc)
961
		goto spq_post_fail;
962
		goto spq_post_fail;
962
963

Return to bug 255868