src/dpdk/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
static inline int
fpga_find_free_queue_idx(struct rte_bbdev *dev,
		const struct rte_bbdev_queue_conf *conf)
{
	struct fpga_5gnr_fec_device *d = dev->data->dev_private;
	uint64_t q_idx;
	uint8_t i = 0;
	uint8_t range = FPGA_TOTAL_NUM_QUEUES >> 1;

	if (conf->op_type == RTE_BBDEV_OP_LDPC_ENC) {
		i = FPGA_NUM_DL_QUEUES;
		range = FPGA_TOTAL_NUM_QUEUES;
	}

	for (; i < range; ++i) {
		q_idx = 1ULL << i;
		/* Check if index of queue is bound to current PF/VF */
		if (d->q_bound_bit_map & q_idx)
			/* Check if found queue was not already assigned */
			if (!(d->q_assigned_bit_map & q_idx)) {
				d->q_assigned_bit_map |= q_idx;
				return i;
			}
	}

	rte_bbdev_log(INFO, "Failed to find free queue on %s", dev->data->name);

	return -1;
}
/**
 * Find index of queue bound to current PF/VF which is unassigned. Return -1
 * when there is no available queue
 */
Find index of queue bound to current PF/VF which is unassigned. Return -1
when there is no available queue
Find index of queue bound to current PF / VF which is unassigned . Return - 1 when there is no available queue
static inline int
fpga_find_free_queue_idx(struct rte_bbdev *dev,
		const struct rte_bbdev_queue_conf *conf)
{
	struct fpga_5gnr_fec_device *d = dev->data->dev_private;
	uint64_t q_idx;
	uint8_t i = 0;
	uint8_t range = FPGA_TOTAL_NUM_QUEUES >> 1;
	if (conf->op_type == RTE_BBDEV_OP_LDPC_ENC) {
		i = FPGA_NUM_DL_QUEUES;
		range = FPGA_TOTAL_NUM_QUEUES;
	}
	for (; i < range; ++i) {
		q_idx = 1ULL << i;
		if (d->q_bound_bit_map & q_idx)
			if (!(d->q_assigned_bit_map & q_idx)) {
				d->q_assigned_bit_map |= q_idx;
				return i;
			}
	}
	rte_bbdev_log(INFO, "Failed to find free queue on %s", dev->data->name);
	return -1;
}
static inline int fpga_find_free_queue_idx ( struct rte_bbdev * dev , const struct rte_bbdev_queue_conf * conf ) { struct fpga_5gnr_fec_device * d = dev -> data -> dev_private ; uint64_t q_idx ; uint8_t i = 0 ; uint8_t range = FPGA_TOTAL_NUM_QUEUES >> 1 ; if ( conf -> op_type == RTE_BBDEV_OP_LDPC_ENC ) { i = FPGA_NUM_DL_QUEUES ; range = FPGA_TOTAL_NUM_QUEUES ; } for ( ; i < range ; ++ i ) { q_idx = 1ULL << i ; if ( d -> q_bound_bit_map & q_idx ) if ( ! ( d -> q_assigned_bit_map & q_idx ) ) { d -> q_assigned_bit_map |= q_idx ; return i ; } } rte_bbdev_log ( INFO , " " , dev -> data -> name ) ; return -1 ; }
Find index of queue bound to current PF/VF which is unassigned.
Find index of queue bound to current PF / VF which is unassigned .
/* Check if index of queue is bound to current PF/VF */ /* Check if found queue was not already assigned */