net/bnxt: convert to SPDX license tag
[dpdk.git] / drivers / net / bnxt / bnxt_rxq.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2014-2018 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _BNXT_RQX_H_
7 #define _BNXT_RQX_H_
8
9 struct bnxt;
10 struct bnxt_rx_ring_info;
11 struct bnxt_cp_ring_info;
12 struct bnxt_rx_queue {
13         struct rte_mempool      *mb_pool; /* mbuf pool for RX ring */
14         struct rte_mbuf         *pkt_first_seg; /* 1st seg of pkt */
15         struct rte_mbuf         *pkt_last_seg; /* Last seg of pkt */
16         uint64_t                mbuf_initializer; /* val to init mbuf */
17         uint16_t                nb_rx_desc; /* num of RX desc */
18         uint16_t                rx_tail; /* cur val of RDT register */
19         uint16_t                nb_rx_hold; /* num held free RX desc */
20         uint16_t                rx_free_thresh; /* max free RX desc to hold */
21         uint16_t                queue_id; /* RX queue index */
22         uint16_t                reg_idx; /* RX queue register index */
23         uint16_t                port_id; /* Device port identifier */
24         uint8_t                 crc_len; /* 0 if CRC stripped, 4 otherwise */
25         uint8_t                 rx_deferred_start; /* not in global dev start */
26
27         struct bnxt             *bp;
28         int                     index;
29         struct bnxt_vnic_info   *vnic;
30
31         uint32_t                        rx_buf_size;
32         uint32_t                        rx_buf_use_size;  /* useable size */
33         struct bnxt_rx_ring_info        *rx_ring;
34         struct bnxt_cp_ring_info        *cp_ring;
35 };
36
37 void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq);
38 int bnxt_mq_rx_configure(struct bnxt *bp);
39 void bnxt_rx_queue_release_op(void *rx_queue);
40 int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
41                                uint16_t queue_idx,
42                                uint16_t nb_desc,
43                                unsigned int socket_id,
44                                const struct rte_eth_rxconf *rx_conf,
45                                struct rte_mempool *mp);
46 void bnxt_free_rx_mbufs(struct bnxt *bp);
47 int bnxt_rx_queue_intr_enable_op(struct rte_eth_dev *eth_dev,
48                                  uint16_t queue_id);
49 int bnxt_rx_queue_intr_disable_op(struct rte_eth_dev *eth_dev,
50                                   uint16_t queue_id);
51 int bnxt_rx_queue_start(struct rte_eth_dev *dev,
52                         uint16_t rx_queue_id);
53 int bnxt_rx_queue_stop(struct rte_eth_dev *dev,
54                        uint16_t rx_queue_id);
55 #endif