net/txgbe: add Rx and Tx init
[dpdk.git] / drivers / net / txgbe / txgbe_rxtx.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2015-2020
3  */
4
5 #ifndef _TXGBE_RXTX_H_
6 #define _TXGBE_RXTX_H_
7
8 #define RTE_PMD_TXGBE_TX_MAX_BURST 32
9 #define RTE_PMD_TXGBE_RX_MAX_BURST 32
10
11 #define TXGBE_TX_MAX_SEG                    40
12
13 /**
14  * Structure associated with each RX queue.
15  */
16 struct txgbe_rx_queue {
17         struct rte_mempool  *mb_pool; /**< mbuf pool to populate RX ring. */
18         uint64_t            rx_ring_phys_addr; /**< RX ring DMA address. */
19         uint16_t            nb_rx_desc; /**< number of RX descriptors. */
20         uint16_t            reg_idx;  /**< RX queue register index. */
21         uint8_t             crc_len;  /**< 0 if CRC stripped, 4 otherwise. */
22         uint8_t             drop_en;  /**< If not 0, set SRRCTL.Drop_En. */
23         uint64_t            offloads; /**< Rx offloads with DEV_RX_OFFLOAD_* */
24 };
25
26 /**
27  * Structure associated with each TX queue.
28  */
29 struct txgbe_tx_queue {
30         uint64_t            tx_ring_phys_addr; /**< TX ring DMA address. */
31         uint16_t            nb_tx_desc;    /**< number of TX descriptors. */
32         /**< Start freeing TX buffers if there are less free descriptors than
33          *   this value.
34          */
35         uint16_t            tx_free_thresh;
36         uint16_t            reg_idx;       /**< TX queue register index. */
37         uint64_t offloads; /**< Tx offload flags of DEV_TX_OFFLOAD_* */
38 };
39
40 void txgbe_set_rx_function(struct rte_eth_dev *dev);
41
42 uint64_t txgbe_get_tx_port_offloads(struct rte_eth_dev *dev);
43 uint64_t txgbe_get_rx_queue_offloads(struct rte_eth_dev *dev);
44 uint64_t txgbe_get_rx_port_offloads(struct rte_eth_dev *dev);
45 uint64_t txgbe_get_tx_queue_offloads(struct rte_eth_dev *dev);
46
47 #endif /* _TXGBE_RXTX_H_ */