src/dpdk/drivers/common/iavf/iavf_adminq.c
enum iavf_status iavf_init_arq(struct iavf_hw *hw)
{
	enum iavf_status ret_code = IAVF_SUCCESS;

	if (hw->aq.arq.count > 0) {
		/* queue already initialized */
		ret_code = IAVF_ERR_NOT_READY;
		goto init_adminq_exit;
	}

	/* verify input for valid configuration */
	if ((hw->aq.num_arq_entries == 0) ||
	    (hw->aq.arq_buf_size == 0)) {
		ret_code = IAVF_ERR_CONFIG;
		goto init_adminq_exit;
	}

	hw->aq.arq.next_to_use = 0;
	hw->aq.arq.next_to_clean = 0;

	/* allocate the ring memory */
	ret_code = iavf_alloc_adminq_arq_ring(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_exit;

	/* allocate buffers in the rings */
	ret_code = iavf_alloc_arq_bufs(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_free_rings;

	/* initialize base registers */
	ret_code = iavf_config_arq_regs(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_free_rings;

	/* success! */
	hw->aq.arq.count = hw->aq.num_arq_entries;
	goto init_adminq_exit;

init_adminq_free_rings:
	iavf_free_adminq_arq(hw);

init_adminq_exit:
	return ret_code;
}
/**
 *  iavf_init_arq - initialize ARQ
 *  @hw: pointer to the hardware structure
 *
 *  The main initialization routine for the Admin Receive (Event) Queue.
 *  Prior to calling this function, drivers *MUST* set the following fields
 *  in the hw->aq structure:
 *     - hw->aq.num_asq_entries
 *     - hw->aq.arq_buf_size
 *
 *  Do *NOT* hold the lock when calling this as the memory allocation routines
 *  called are not going to be atomic context safe
 **/
initialize ARQ
@hw: pointer to the hardware structure

The main initialization routine for the Admin Receive (Event) Queue.

Do *NOT* hold the lock when calling this as the memory allocation routines
called are not going to be atomic context safe
initialize ARQ @hw : pointer to the hardware structure The main initialization routine for the Admin Receive ( Event ) Queue . Do * NOT * hold the lock when calling this as the memory allocation routines called are not going to be atomic context safe
enum iavf_status iavf_init_arq(struct iavf_hw *hw)
{
	enum iavf_status ret_code = IAVF_SUCCESS;
	if (hw->aq.arq.count > 0) {
		ret_code = IAVF_ERR_NOT_READY;
		goto init_adminq_exit;
	}
	if ((hw->aq.num_arq_entries == 0) ||
	    (hw->aq.arq_buf_size == 0)) {
		ret_code = IAVF_ERR_CONFIG;
		goto init_adminq_exit;
	}
	hw->aq.arq.next_to_use = 0;
	hw->aq.arq.next_to_clean = 0;
	ret_code = iavf_alloc_adminq_arq_ring(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_exit;
	ret_code = iavf_alloc_arq_bufs(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_free_rings;
	ret_code = iavf_config_arq_regs(hw);
	if (ret_code != IAVF_SUCCESS)
		goto init_adminq_free_rings;
	hw->aq.arq.count = hw->aq.num_arq_entries;
	goto init_adminq_exit;
init_adminq_free_rings:
	iavf_free_adminq_arq(hw);
init_adminq_exit:
	return ret_code;
}
enum iavf_status iavf_init_arq ( struct iavf_hw * hw ) { enum iavf_status ret_code = IAVF_SUCCESS ; if ( hw -> aq . arq . count > 0 ) { ret_code = IAVF_ERR_NOT_READY ; goto init_adminq_exit ; } if ( ( hw -> aq . num_arq_entries == 0 ) || ( hw -> aq . arq_buf_size == 0 ) ) { ret_code = IAVF_ERR_CONFIG ; goto init_adminq_exit ; } hw -> aq . arq . next_to_use = 0 ; hw -> aq . arq . next_to_clean = 0 ; ret_code = iavf_alloc_adminq_arq_ring ( hw ) ; if ( ret_code != IAVF_SUCCESS ) goto init_adminq_exit ; ret_code = iavf_alloc_arq_bufs ( hw ) ; if ( ret_code != IAVF_SUCCESS ) goto init_adminq_free_rings ; ret_code = iavf_config_arq_regs ( hw ) ; if ( ret_code != IAVF_SUCCESS ) goto init_adminq_free_rings ; hw -> aq . arq . count = hw -> aq . num_arq_entries ; goto init_adminq_exit ; init_adminq_free_rings : iavf_free_adminq_arq ( hw ) ; init_adminq_exit : return ret_code ; }
iavf_init_arq - initialize ARQ
  @hw: pointer to the hardware structure
iavf_init_arq - initialize ARQ @hw : pointer to the hardware structure
/* queue already initialized */ /* verify input for valid configuration */ /* allocate the ring memory */ /* allocate buffers in the rings */ /* initialize base registers */ /* success! */