1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium, Inc
9 * This file defines common macros and structs
13 * Macros to determine CPT model. Driver makefile will define CPT_MODEL
16 #define CRYPTO_OCTEONTX 0x1
18 #define TIME_IN_RESET_COUNT 5
20 /* Default command timeout in seconds */
21 #define DEFAULT_COMMAND_TIMEOUT 4
23 #define CPT_COUNT_THOLD 32
24 #define CPT_TIMER_THOLD 0x3F
30 #define ROUNDUP4(val) (((val) + 3) & 0xfffffffc)
34 #define ROUNDUP8(val) (((val) + 7) & 0xfffffff8)
38 #define ROUNDUP16(val) (((val) + 15) & 0xfffffff0)
42 #define __hot __attribute__((hot))
45 #define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++)
47 struct cptvf_meta_info {
48 void *cptvf_meta_pool;
54 /** Request id of a crypto operation */
59 * Pending queue structure
62 struct pending_queue {
63 /** Pending requests count */
64 uint64_t pending_count;
65 /** Array of pending requests */
66 struct rid *rid_queue;
67 /** Tail of queue to be used for enqueue */
69 /** Head of queue to be used for dequeue */
73 struct cpt_request_info {
74 /** Data path fields */
76 volatile uint64_t *completion_addr;
77 volatile uint64_t *alternate_caddr;
86 /** Control path fields */
89 } __rte_cache_aligned;
91 #endif /* _CPT_COMMON_H_ */