1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2018 Broadcom
9 /* Maximum receive burst supported in vector mode. */
10 #define RTE_BNXT_MAX_RX_BURST 64U
12 /* Drop by default when receive desc is not available. */
13 #define BNXT_DEFAULT_RX_DROP_EN 1
16 struct bnxt_rx_ring_info;
17 struct bnxt_cp_ring_info;
18 struct bnxt_rx_queue {
19 rte_spinlock_t lock; /* Synchronize between rx_queue_stop
22 struct rte_mempool *mb_pool; /* mbuf pool for RX ring */
23 struct rte_mbuf *pkt_first_seg; /* 1st seg of pkt */
24 struct rte_mbuf *pkt_last_seg; /* Last seg of pkt */
25 uint64_t mbuf_initializer; /* val to init mbuf */
26 uint16_t nb_rx_desc; /* num of RX desc */
27 uint16_t rx_tail; /* cur val of RDT register */
28 uint16_t nb_rx_hold; /* num held free RX desc */
29 uint16_t rx_free_thresh; /* max free RX desc to hold */
30 uint16_t queue_id; /* RX queue index */
31 #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
32 uint16_t rxrearm_nb; /* number of descs to reinit. */
33 uint16_t rxrearm_start; /* next desc index to reinit. */
35 uint16_t reg_idx; /* RX queue register index */
36 uint16_t port_id; /* Device port identifier */
37 uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */
38 uint8_t rx_deferred_start; /* not in global dev start */
39 uint8_t rx_started; /* RX queue is started */
40 uint8_t drop_en; /* Drop when rx desc not available. */
44 struct bnxt_vnic_info *vnic;
47 struct bnxt_rx_ring_info *rx_ring;
48 struct bnxt_cp_ring_info *cp_ring;
49 struct rte_mbuf fake_mbuf;
50 rte_atomic64_t rx_mbuf_alloc_fail;
51 const struct rte_memzone *mz;
54 void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq);
55 int bnxt_mq_rx_configure(struct bnxt *bp);
56 void bnxt_rx_queue_release_op(void *rx_queue);
57 int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
60 unsigned int socket_id,
61 const struct rte_eth_rxconf *rx_conf,
62 struct rte_mempool *mp);
63 void bnxt_free_rx_mbufs(struct bnxt *bp);
64 int bnxt_rx_queue_intr_enable_op(struct rte_eth_dev *eth_dev,
66 int bnxt_rx_queue_intr_disable_op(struct rte_eth_dev *eth_dev,
68 int bnxt_rx_queue_start(struct rte_eth_dev *dev,
69 uint16_t rx_queue_id);
70 int bnxt_rx_queue_stop(struct rte_eth_dev *dev,
71 uint16_t rx_queue_id);
72 void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq);