src/dpdk/drivers/net/qede/base/ecore_l2.c
static bool ecore_eth_queue_qid_usage_add(struct ecore_hwfn *p_hwfn,
					  struct ecore_queue_cid *p_cid)
{
	struct ecore_l2_info *p_l2_info = p_hwfn->p_l2_info;
	u16 queue_id = p_cid->rel.queue_id;
	bool b_rc = true;
	u8 first;

	OSAL_MUTEX_ACQUIRE(&p_l2_info->lock);

	if (queue_id > p_l2_info->queues) {
		DP_NOTICE(p_hwfn, true,
			  "Requested to increase usage for qzone %04x out of %08x\n",
			  queue_id, p_l2_info->queues);
		b_rc = false;
		goto out;
	}

	first = (u8)OSAL_FIND_FIRST_ZERO_BIT(p_l2_info->pp_qid_usage[queue_id],
					     MAX_QUEUES_PER_QZONE);
	if (first >= MAX_QUEUES_PER_QZONE) {
		b_rc = false;
		goto out;
	}

	OSAL_SET_BIT(first, p_l2_info->pp_qid_usage[queue_id]);
	p_cid->qid_usage_idx = first;

out:
	OSAL_MUTEX_RELEASE(&p_l2_info->lock);
	return b_rc;
}
/* TODO - we'll need locking around these... */
we'll need locking around these
we ' ll need locking around these
static bool ecore_eth_queue_qid_usage_add(struct ecore_hwfn *p_hwfn,
					  struct ecore_queue_cid *p_cid)
{
	struct ecore_l2_info *p_l2_info = p_hwfn->p_l2_info;
	u16 queue_id = p_cid->rel.queue_id;
	bool b_rc = true;
	u8 first;
	OSAL_MUTEX_ACQUIRE(&p_l2_info->lock);
	if (queue_id > p_l2_info->queues) {
		DP_NOTICE(p_hwfn, true,
			  "Requested to increase usage for qzone %04x out of %08x\n",
			  queue_id, p_l2_info->queues);
		b_rc = false;
		goto out;
	}
	first = (u8)OSAL_FIND_FIRST_ZERO_BIT(p_l2_info->pp_qid_usage[queue_id],
					     MAX_QUEUES_PER_QZONE);
	if (first >= MAX_QUEUES_PER_QZONE) {
		b_rc = false;
		goto out;
	}
	OSAL_SET_BIT(first, p_l2_info->pp_qid_usage[queue_id]);
	p_cid->qid_usage_idx = first;
out:
	OSAL_MUTEX_RELEASE(&p_l2_info->lock);
	return b_rc;
}
static bool ecore_eth_queue_qid_usage_add ( struct ecore_hwfn * p_hwfn , struct ecore_queue_cid * p_cid ) { struct ecore_l2_info * p_l2_info = p_hwfn -> p_l2_info ; u16 queue_id = p_cid -> rel . queue_id ; bool b_rc = true ; u8 first ; OSAL_MUTEX_ACQUIRE ( & p_l2_info -> lock ) ; if ( queue_id > p_l2_info -> queues ) { DP_NOTICE ( p_hwfn , true , " \n " , queue_id , p_l2_info -> queues ) ; b_rc = false ; goto out ; } first = ( u8 ) OSAL_FIND_FIRST_ZERO_BIT ( p_l2_info -> pp_qid_usage [ queue_id ] , MAX_QUEUES_PER_QZONE ) ; if ( first >= MAX_QUEUES_PER_QZONE ) { b_rc = false ; goto out ; } OSAL_SET_BIT ( first , p_l2_info -> pp_qid_usage [ queue_id ] ) ; p_cid -> qid_usage_idx = first ; out : OSAL_MUTEX_RELEASE ( & p_l2_info -> lock ) ; return b_rc ; }
TODO - we'll need locking around these...
TODO - we ' ll need locking around these ...