1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2019 Marvell International Ltd.
5 #ifndef _OTX2_EP_ENQDEQ_H_
6 #define _OTX2_EP_ENQDEQ_H_
8 #include <rte_byteorder.h>
9 #include "otx2_ep_rawdev.h"
11 #define SDP_IQ_SEND_FAILED (-1)
12 #define SDP_IQ_SEND_SUCCESS (0)
14 #define SDP_OQ_RECV_FAILED (-1)
15 #define SDP_OQ_RECV_SUCCESS (0)
17 static inline uint64_t
18 sdp_endian_swap_8B(uint64_t _d)
20 return ((((((uint64_t)(_d)) >> 0) & (uint64_t)0xff) << 56) |
21 (((((uint64_t)(_d)) >> 8) & (uint64_t)0xff) << 48) |
22 (((((uint64_t)(_d)) >> 16) & (uint64_t)0xff) << 40) |
23 (((((uint64_t)(_d)) >> 24) & (uint64_t)0xff) << 32) |
24 (((((uint64_t)(_d)) >> 32) & (uint64_t)0xff) << 24) |
25 (((((uint64_t)(_d)) >> 40) & (uint64_t)0xff) << 16) |
26 (((((uint64_t)(_d)) >> 48) & (uint64_t)0xff) << 8) |
27 (((((uint64_t)(_d)) >> 56) & (uint64_t)0xff) << 0));
31 sdp_swap_8B_data(uint64_t *data, uint32_t blocks)
35 *data = sdp_endian_swap_8B(*data);
41 static inline uint32_t
42 sdp_incr_index(uint32_t index, uint32_t count, uint32_t max)
44 if ((index + count) >= max)
45 index = index + count - max;
52 #endif /* _OTX2_EP_ENQDEQ_H_ */