1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium, Inc
9 * This file defines common macros and structs
12 #define TIME_IN_RESET_COUNT 5
14 /* Default command timeout in seconds */
15 #define DEFAULT_COMMAND_TIMEOUT 4
17 #define CPT_COUNT_THOLD 32
18 #define CPT_TIMER_THOLD 0x3F
24 #define ROUNDUP4(val) (((val) + 3) & 0xfffffffc)
28 #define ROUNDUP8(val) (((val) + 7) & 0xfffffff8)
32 #define ROUNDUP16(val) (((val) + 15) & 0xfffffff0)
36 #define __hot __attribute__((hot))
39 #define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++)
41 struct cptvf_meta_info {
42 void *cptvf_meta_pool;
48 /** Request id of a crypto operation */
53 * Pending queue structure
56 struct pending_queue {
57 /** Pending requests count */
58 uint64_t pending_count;
59 /** Array of pending requests */
60 struct rid *rid_queue;
61 /** Tail of queue to be used for enqueue */
63 /** Head of queue to be used for dequeue */
67 struct cpt_request_info {
68 /** Data path fields */
70 volatile uint64_t *completion_addr;
71 volatile uint64_t *alternate_caddr;
80 /** Control path fields */
83 } __rte_cache_aligned;
85 #endif /* _CPT_COMMON_H_ */