xref: /dpdk/drivers/net/octeontx_ep/otx_ep_rxtx.h (revision 9526f300)
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 1
11 #define OTX_EP_TXD_ALIGN 1
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 10000
17 
18 #define OTX_EP_FSZ 28
19 #define OTX2_EP_FSZ 24
20 #define OTX_EP_MAX_INSTR 16
21 
22 static inline void
otx_ep_swap_8B_data(uint64_t * data,uint32_t blocks)23 otx_ep_swap_8B_data(uint64_t *data, uint32_t blocks)
24 {
25 	/* Swap 8B blocks */
26 	while (blocks) {
27 		*data = rte_bswap64(*data);
28 		blocks--;
29 		data++;
30 	}
31 }
32 
33 static inline uint32_t
otx_ep_incr_index(uint32_t index,uint32_t count,uint32_t max)34 otx_ep_incr_index(uint32_t index, uint32_t count, uint32_t max)
35 {
36 	return ((index + count) & (max - 1));
37 }
38 uint16_t
39 otx_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts);
40 uint16_t
41 otx2_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts);
42 uint16_t
43 otx_ep_recv_pkts(void *rx_queue,
44 		  struct rte_mbuf **rx_pkts,
45 		  uint16_t budget);
46 #endif /* _OTX_EP_RXTX_H_ */
47