xref: /dpdk/drivers/net/bnxt/bnxt_txq.h (revision 6cc5dfa69a0335849fc0903d3ada943acb33c7ce)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2014-2023 Broadcom
3  * All rights reserved.
4  */
5 
6 #ifndef _BNXT_TXQ_H_
7 #define _BNXT_TXQ_H_
8 
9 /* Maximum transmit burst for vector mode.  */
10 #define RTE_BNXT_MAX_TX_BURST		64U
11 
12 struct bnxt_tx_ring_info;
13 struct bnxt_cp_ring_info;
14 struct bnxt_tx_queue {
15 	uint16_t		nb_tx_desc;    /* number of TX descriptors */
16 	uint16_t		tx_free_thresh;/* minimum TX before freeing */
17 	uint16_t		queue_id; /* TX queue index */
18 	uint16_t		port_id; /* Device port identifier */
19 	uint8_t			pthresh; /* Prefetch threshold register */
20 	uint8_t			hthresh; /* Host threshold register */
21 	uint8_t			wthresh; /* Write-back threshold reg */
22 	uint8_t			tx_deferred_start; /* not in global dev start */
23 	uint8_t			tx_started; /* TX queue is started */
24 
25 	struct bnxt		*bp;
26 	int			index;
27 	int			tx_wake_thresh;
28 	uint32_t		vfr_tx_cfa_action;
29 	pthread_mutex_t		txq_lock;
30 	struct bnxt_tx_ring_info	*tx_ring;
31 
32 	unsigned int		cp_nr_rings;
33 	struct bnxt_cp_ring_info	*cp_ring;
34 	const struct rte_memzone *mz;
35 	struct rte_mbuf **free;
36 	uint64_t offloads;
37 	RTE_ATOMIC(uint64_t)	tx_mbuf_drop;
38 };
39 
40 void bnxt_free_txq_stats(struct bnxt_tx_queue *txq);
41 void bnxt_free_tx_mbufs(struct bnxt *bp);
42 void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx);
43 int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
44 			       uint16_t queue_idx,
45 			       uint16_t nb_desc,
46 			       unsigned int socket_id,
47 			       const struct rte_eth_txconf *tx_conf);
48 uint64_t bnxt_get_tx_port_offloads(struct bnxt *bp);
49 #endif
50