New upstream version 18.08
[deb_dpdk.git] / drivers / net / bnxt / bnxt_txq.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2014-2018 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _BNXT_TXQ_H_
7 #define _BNXT_TXQ_H_
8
9 struct bnxt_tx_ring_info;
10 struct bnxt_cp_ring_info;
11 struct bnxt_tx_queue {
12         uint16_t                nb_tx_desc;    /* number of TX descriptors */
13         uint16_t                tx_free_thresh;/* minimum TX before freeing */
14         /** Index to last TX descriptor to have been cleaned. */
15         uint16_t                last_desc_cleaned;
16         /** Total number of TX descriptors ready to be allocated. */
17         uint16_t                tx_next_dd; /* next desc to scan for DD bit */
18         uint16_t                tx_next_rs; /* next desc to set RS bit */
19         uint16_t                queue_id; /* TX queue index */
20         uint16_t                reg_idx; /* TX queue register index */
21         uint16_t                port_id; /* Device port identifier */
22         uint8_t                 pthresh; /* Prefetch threshold register */
23         uint8_t                 hthresh; /* Host threshold register */
24         uint8_t                 wthresh; /* Write-back threshold reg */
25         uint32_t                ctx_curr; /* Hardware context states */
26         uint8_t                 tx_deferred_start; /* not in global dev start */
27         uint8_t                 cmpl_next; /* Next BD to trigger a compl */
28
29         struct bnxt             *bp;
30         int                     index;
31         int                     tx_wake_thresh;
32         struct bnxt_tx_ring_info        *tx_ring;
33
34         unsigned int            cp_nr_rings;
35         struct bnxt_cp_ring_info        *cp_ring;
36         const struct rte_memzone *mz;
37 };
38
39 void bnxt_free_txq_stats(struct bnxt_tx_queue *txq);
40 void bnxt_free_tx_mbufs(struct bnxt *bp);
41 void bnxt_tx_queue_release_op(void *tx_queue);
42 int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
43                                uint16_t queue_idx,
44                                uint16_t nb_desc,
45                                unsigned int socket_id,
46                                const struct rte_eth_txconf *tx_conf);
47 #endif