xref: /dpdk/drivers/net/octeon_ep/otx_ep_rxtx.h (revision 831cf744eeff64b93c96cee2fbeb12fca24c03b4)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4 
5 #ifndef _OTX_EP_RXTX_H_
6 #define _OTX_EP_RXTX_H_
7 
8 #include <rte_byteorder.h>
9 
10 #define OTX_EP_RXD_ALIGN 8
11 #define OTX_EP_TXD_ALIGN 8
12 
13 #define OTX_EP_IQ_SEND_FAILED      (-1)
14 #define OTX_EP_IQ_SEND_SUCCESS     (0)
15 
16 #define OTX_EP_MAX_DELAYED_PKT_RETRIES 10
17 
18 #define OTX_EP_FSZ 28
19 #define OTX2_EP_FSZ 24
20 #define OTX_EP_MAX_INSTR 256
21 
22 /* SDP_LENGTH_S specifies packet length and is of 8-byte size */
23 #define OTX_EP_INFO_SIZE 8
24 #define DROQ_REFILL_THRESHOLD  64
25 #define OTX2_SDP_REQUEST_ISM   (0x1ULL << 63)
26 
27 typedef uint32_t (*otx_ep_check_pkt_count_t)(void *queue);
28 
29 static inline uint32_t
otx_ep_incr_index(uint32_t index,uint32_t count,uint32_t max)30 otx_ep_incr_index(uint32_t index, uint32_t count, uint32_t max)
31 {
32 	return ((index + count) & (max - 1));
33 }
34 
35 uint16_t
36 otx_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts);
37 
38 uint16_t
39 otx2_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts);
40 
41 uint16_t
42 otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
43 
44 uint16_t
45 cnxk_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts);
46 
47 uint16_t
48 cnxk_ep_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts);
49 
50 uint16_t
51 cnxk_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
52 
53 uint16_t
54 cnxk_ep_recv_pkts_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
55 
56 uint16_t
57 cnxk_ep_recv_pkts_avx(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
58 
59 uint16_t
60 cnxk_ep_recv_pkts_mseg(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
61 
62 uint16_t
63 cn9k_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
64 
65 uint16_t
66 cnxk_ep_recv_pkts_neon(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
67 
68 uint16_t
69 cn9k_ep_recv_pkts_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
70 
71 uint16_t
72 cn9k_ep_recv_pkts_avx(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
73 
74 uint16_t
75 cn9k_ep_recv_pkts_neon(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
76 
77 uint16_t
78 cn9k_ep_recv_pkts_mseg(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget);
79 #endif /* _OTX_EP_RXTX_H_ */
80