1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium, Inc
8 #include <rte_mempool.h>
11 * This file defines common macros and structs
14 #define TIME_IN_RESET_COUNT 5
16 /* Default command timeout in seconds */
17 #define DEFAULT_COMMAND_TIMEOUT 4
19 #define CPT_COUNT_THOLD 32
20 #define CPT_TIMER_THOLD 0x3F
26 #define ROUNDUP4(val) (((val) + 3) & 0xfffffffc)
30 #define ROUNDUP8(val) (((val) + 7) & 0xfffffff8)
34 #define ROUNDUP16(val) (((val) + 15) & 0xfffffff0)
38 #define __hot __attribute__((hot))
41 #define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++)
43 struct cpt_qp_meta_info {
44 struct rte_mempool *pool;
50 /** Request id of a crypto operation */
55 * Pending queue structure
58 struct pending_queue {
59 /** Pending requests count */
60 uint64_t pending_count;
61 /** Array of pending requests */
62 struct rid *rid_queue;
63 /** Tail of queue to be used for enqueue */
65 /** Head of queue to be used for dequeue */
69 struct cpt_request_info {
70 /** Data path fields */
72 volatile uint64_t *completion_addr;
73 volatile uint64_t *alternate_caddr;
82 /** Control path fields */
85 } __rte_cache_aligned;
87 #endif /* _CPT_COMMON_H_ */