1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
3 * Copyright (c) 2015-2018 Cavium Inc.
11 #define DEFAULT_TX_FREE_THRESH 64
12 #define RTE_PMD_BNX2X_TX_MAX_BURST 1
15 * Structure associated with each descriptor of the RX ring of a RX queue.
17 struct bnx2x_rx_entry {
18 struct rte_mbuf *mbuf; /**< mbuf associated with RX descriptor. */
22 * Structure associated with each RX queue.
24 struct bnx2x_rx_queue {
25 struct rte_mempool *mb_pool; /**< mbuf pool to populate RX ring. */
26 union eth_rx_cqe *cq_ring; /**< RCQ ring virtual address. */
27 uint64_t cq_ring_phys_addr; /**< RCQ ring DMA address. */
28 uint64_t *rx_ring; /**< RX ring virtual address. */
29 uint64_t rx_ring_phys_addr; /**< RX ring DMA address. */
30 struct rte_mbuf **sw_ring; /**< address of RX software ring. */
31 struct rte_mbuf *pkt_first_seg; /**< First segment of current packet. */
32 struct rte_mbuf *pkt_last_seg; /**< Last segment of current packet. */
33 uint16_t nb_cq_pages; /**< number of RCQ pages. */
34 uint16_t nb_rx_desc; /**< number of RX descriptors. */
35 uint16_t nb_rx_pages; /**< number of RX pages. */
36 uint16_t rx_bd_head; /**< Index of current rx bd. */
37 uint16_t rx_bd_tail; /**< Index of last rx bd. */
38 uint16_t rx_cq_head; /**< Index of current rcq bd. */
39 uint16_t rx_cq_tail; /**< Index of last rcq bd. */
40 uint16_t queue_id; /**< RX queue index. */
41 uint16_t port_id; /**< Device port identifier. */
42 struct bnx2x_softc *sc; /**< Ptr to dev_private data. */
46 * Structure associated with each TX queue.
48 struct bnx2x_tx_queue {
49 /** TX ring virtual address. */
50 union eth_tx_bd_types *tx_ring; /**< TX ring virtual address. */
51 uint64_t tx_ring_phys_addr; /**< TX ring DMA address. */
52 struct rte_mbuf **sw_ring; /**< virtual address of SW ring. */
53 uint16_t tx_pkt_tail; /**< Index of current tx pkt. */
54 uint16_t tx_pkt_head; /**< Index of last pkt counted by txeof. */
55 uint16_t tx_bd_tail; /**< Index of current tx bd. */
56 uint16_t tx_bd_head; /**< Index of last bd counted by txeof. */
57 uint16_t nb_tx_desc; /**< number of TX descriptors. */
58 uint16_t tx_free_thresh; /**< minimum TX before freeing. */
59 uint16_t nb_tx_avail; /**< Number of TX descriptors available. */
60 uint16_t nb_tx_pages; /**< number of TX pages */
61 uint16_t queue_id; /**< TX queue index. */
62 uint16_t port_id; /**< Device port identifier. */
63 struct bnx2x_softc *sc; /**< Ptr to dev_private data */
66 int bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
67 uint16_t nb_rx_desc, unsigned int socket_id,
68 const struct rte_eth_rxconf *rx_conf,
69 struct rte_mempool *mb_pool);
71 int bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
72 uint16_t nb_tx_desc, unsigned int socket_id,
73 const struct rte_eth_txconf *tx_conf);
75 void bnx2x_dev_rx_queue_release(void *rxq);
76 void bnx2x_dev_tx_queue_release(void *txq);
77 void bnx2x_dev_rxtx_init(struct rte_eth_dev *dev);
78 void bnx2x_dev_rxtx_init_dummy(struct rte_eth_dev *dev);
79 void bnx2x_dev_clear_queues(struct rte_eth_dev *dev);
81 #endif /* _BNX2X_RXTX_H_ */