1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
11 /**< Intel(R) QAT device name for PCI registration */
12 #define QAT_PCI_NAME qat
13 #define QAT_64_BTYE_ALIGN_MASK (~0x3f)
15 /* Intel(R) QuickAssist Technology device generation is enumerated
16 * from one according to the generation of the device
24 enum qat_service_type {
25 QAT_SERVICE_ASYMMETRIC = 0,
26 QAT_SERVICE_SYMMETRIC,
27 QAT_SERVICE_COMPRESSION,
31 #define QAT_MAX_SERVICES (QAT_SERVICE_INVALID)
33 /**< Common struct for scatter-gather list operations */
40 #define qat_sgl_hdr struct { \
43 uint32_t num_mapped_bufs; \
49 /* flexible array of flat buffers*/
50 struct qat_flat_buf buffers[0];
51 } __rte_packed __rte_cache_aligned;
53 /** Common, i.e. not service-specific, statistics */
54 struct qat_common_stats {
55 uint64_t enqueued_count;
56 /**< Count of all operations enqueued */
57 uint64_t dequeued_count;
58 /**< Count of all operations dequeued */
60 uint64_t enqueue_err_count;
61 /**< Total error count on operations enqueued */
62 uint64_t dequeue_err_count;
63 /**< Total error count on operations dequeued */
64 uint64_t threshold_hit_count;
65 /**< Total number of times min qp threshold condition was fulfilled */
69 struct qat_pci_device;
72 qat_sgl_fill_array(struct rte_mbuf *buf, int64_t offset,
73 void *list_in, uint32_t data_len,
74 const uint16_t max_segs);
76 qat_stats_get(struct qat_pci_device *dev,
77 struct qat_common_stats *stats,
78 enum qat_service_type service);
80 qat_stats_reset(struct qat_pci_device *dev,
81 enum qat_service_type service);
83 #endif /* _QAT_COMMON_H_ */