1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Cesnet
3 * Copyright(c) 2019 Netcope Technologies, a.s. <info@netcope.com>
11 nfb_eth_tx_queue_start(struct rte_eth_dev *dev, uint16_t txq_id)
13 struct ndp_tx_queue *txq = dev->data->tx_queues[txq_id];
16 if (txq->queue == NULL) {
17 RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
21 ret = ndp_queue_start(txq->queue);
24 dev->data->tx_queue_state[txq_id] = RTE_ETH_QUEUE_STATE_STARTED;
32 nfb_eth_tx_queue_stop(struct rte_eth_dev *dev, uint16_t txq_id)
34 struct ndp_tx_queue *txq = dev->data->tx_queues[txq_id];
37 if (txq->queue == NULL) {
38 RTE_LOG(ERR, PMD, "TX NDP queue is NULL!\n");
42 ret = ndp_queue_stop(txq->queue);
45 dev->data->tx_queue_state[txq_id] = RTE_ETH_QUEUE_STATE_STOPPED;
50 nfb_eth_tx_queue_setup(struct rte_eth_dev *dev,
52 uint16_t nb_tx_desc __rte_unused,
53 unsigned int socket_id,
54 const struct rte_eth_txconf *tx_conf __rte_unused)
56 struct pmd_internals *internals = dev->data->dev_private;
58 struct ndp_tx_queue *txq;
60 txq = rte_zmalloc_socket("ndp tx queue",
61 sizeof(struct ndp_tx_queue),
62 RTE_CACHE_LINE_SIZE, socket_id);
65 RTE_LOG(ERR, PMD, "rte_zmalloc_socket() failed for tx queue id "
66 "%" PRIu16 "!\n", tx_queue_id);
70 ret = nfb_eth_tx_queue_init(internals->nfb,
75 dev->data->tx_queues[tx_queue_id] = txq;
83 nfb_eth_tx_queue_init(struct nfb_device *nfb,
85 struct ndp_tx_queue *txq)
90 txq->queue = ndp_open_tx_queue(nfb, tx_queue_id);
91 if (txq->queue == NULL)
95 txq->tx_queue_id = tx_queue_id;
105 nfb_eth_tx_queue_release(void *q)
107 struct ndp_tx_queue *txq = (struct ndp_tx_queue *)q;
108 if (txq->queue != NULL) {
109 ndp_close_tx_queue(txq->queue);