src/dpdk/drivers/bus/dpaa/include/fsl_qman.h
static inline int qman_poll_fq_for_init(struct qman_fq *fq)
{
	struct qm_mcr_queryfq_np np;
	int err;

	err = qman_query_fq_np(fq, &np);
	if (err)
		return err;
	if ((np.state & QM_MCR_NP_STATE_MASK) == QM_MCR_NP_STATE_OOS)
		return 1;
	return 0;
}
/* Helpers */
/* ------- */
/**
 * qman_poll_fq_for_init - Check if an FQ has been initialised from OOS
 * @fqid: the FQID that will be initialised by other s/w
 *
 * In many situations, a FQID is provided for communication between s/w
 * entities, and whilst the consumer is responsible for initialising and
 * scheduling the FQ, the producer(s) generally create a wrapper FQ object using
 * and only call qman_enqueue() (no FQ initialisation, scheduling, etc). Ie;
 *     qman_create_fq(..., QMAN_FQ_FLAG_NO_MODIFY, ...);
 * However, data can not be enqueued to the FQ until it is initialised out of
 * the OOS state - this function polls for that condition. It is particularly
 * useful for users of IPC functions - each endpoint's Rx FQ is the other
 * endpoint's Tx FQ, so each side can initialise and schedule their Rx FQ object
 * and then use this API on the (NO_MODIFY) Tx FQ object in order to
 * synchronise. The function returns zero for success, +1 if the FQ is still in
 * the OOS state, or negative if there was an error.
 */
Helpers

Check if an FQ has been initialised from OOS
@fqid: the FQID that will be initialised by other s/w

In many situations, a FQID is provided for communication between s/w
entities, and whilst the consumer is responsible for initialising and
scheduling the FQ, the producer(s) generally create a wrapper FQ object using
and only call qman_enqueue() (no FQ initialisation, scheduling, etc). Ie;
qman_create_fq(..., QMAN_FQ_FLAG_NO_MODIFY, ...);
However, data can not be enqueued to the FQ until it is initialised out of
the OOS state - this function polls for that condition. It is particularly
useful for users of IPC functions - each endpoint's Rx FQ is the other
endpoint's Tx FQ, so each side can initialise and schedule their Rx FQ object
and then use this API on the (NO_MODIFY) Tx FQ object in order to
synchronise. The function returns zero for success, +1 if the FQ is still in
the OOS state, or negative if there was an error.
Helpers Check if an FQ has been initialised from OOS @fqid : the FQID that will be initialised by other s / w In many situations a FQID is provided for communication between s / w entities and whilst the consumer is responsible for initialising and scheduling the FQ the producer ( s ) generally create a wrapper FQ object using and only call qman_enqueue () ( no FQ initialisation scheduling etc ) . Ie ; qman_create_fq ( ... QMAN_FQ_FLAG_NO_MODIFY ... ) ; However data can not be enqueued to the FQ until it is initialised out of the OOS state - this function polls for that condition . It is particularly useful for users of IPC functions - each endpoint ' s Rx FQ is the other endpoint ' s Tx FQ so each side can initialise and schedule their Rx FQ object and then use this API on the ( NO_MODIFY ) Tx FQ object in order to synchronise . The function returns zero for success + 1 if the FQ is still in the OOS state or negative if there was an error .
static inline int qman_poll_fq_for_init(struct qman_fq *fq)
{
	struct qm_mcr_queryfq_np np;
	int err;
	err = qman_query_fq_np(fq, &np);
	if (err)
		return err;
	if ((np.state & QM_MCR_NP_STATE_MASK) == QM_MCR_NP_STATE_OOS)
		return 1;
	return 0;
}
static inline int qman_poll_fq_for_init ( struct qman_fq * fq ) { struct qm_mcr_queryfq_np np ; int err ; err = qman_query_fq_np ( fq , & np ) ; if ( err ) return err ; if ( ( np . state & QM_MCR_NP_STATE_MASK ) == QM_MCR_NP_STATE_OOS ) return 1 ; return 0 ; }
Helpers
Helpers