Exemplo n.º 1
0
static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
	uint16_t queue_idx,
	uint16_t nb_desc,
	unsigned int socket_id,
	const struct rte_eth_rxconf *rx_conf,
	struct rte_mempool *mp)
{
	int ret;
	struct enic *enic = pmd_priv(eth_dev);

	ENICPMD_FUNC_TRACE();

	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
		return -E_RTE_SECONDARY;
	RTE_ASSERT(enic_rte_rq_idx_to_sop_idx(queue_idx) < enic->conf_rq_count);
	eth_dev->data->rx_queues[queue_idx] =
		(void *)&enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];

	ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc,
			    rx_conf->rx_free_thresh);
	if (ret) {
		dev_err(enic, "error in allocating rq\n");
		return ret;
	}

	return enicpmd_dev_setup_intr(enic);
}
Exemplo n.º 2
0
static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
	uint16_t queue_idx,
	uint16_t nb_desc,
	unsigned int socket_id,
	const struct rte_eth_rxconf *rx_conf,
	struct rte_mempool *mp)
{
	int ret;
	struct enic *enic = pmd_priv(eth_dev);

	ENICPMD_FUNC_TRACE();
	/* With Rx scatter support, two RQs are now used on VIC per RQ used
	 * by the application.
	 */
	if (queue_idx * 2 >= ENIC_RQ_MAX) {
		dev_err(enic,
			"Max number of RX queues exceeded.  Max is %d. This PMD uses 2 RQs on VIC per RQ used by DPDK.\n",
			ENIC_RQ_MAX);
		return -EINVAL;
	}

	eth_dev->data->rx_queues[queue_idx] =
		(void *)&enic->rq[enic_sop_rq(queue_idx)];

	ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc);
	if (ret) {
		dev_err(enic, "error in allocating rq\n");
		return ret;
	}

	enic->rq[queue_idx].rx_free_thresh = rx_conf->rx_free_thresh;
	dev_debug(enic, "Set queue_id:%u free thresh:%u\n", queue_idx,
			enic->rq[queue_idx].rx_free_thresh);

	return enicpmd_dev_setup_intr(enic);
}