X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fcpt%2Fcpt_common.h;h=0141b2aed5f2698362ccc8368a100af4f6440ada;hb=8ed3b9e6e4991932ddf0a10dee4ef8ac8f46f741;hp=5e2099a29fac115c0aa8c1d70276e7c34bd20c61;hpb=0dc1cffa4d33b17025ad2350e17cf7b21481b35f;p=dpdk.git diff --git a/drivers/common/cpt/cpt_common.h b/drivers/common/cpt/cpt_common.h index 5e2099a29f..0141b2aed5 100644 --- a/drivers/common/cpt/cpt_common.h +++ b/drivers/common/cpt/cpt_common.h @@ -5,23 +5,38 @@ #ifndef _CPT_COMMON_H_ #define _CPT_COMMON_H_ +#include + /* * This file defines common macros and structs */ -/* - * Macros to determine CPT model. Driver makefile will define CPT_MODEL - * accordingly - */ -#define CRYPTO_OCTEONTX 0x1 +#define TIME_IN_RESET_COUNT 5 + +/* Default command timeout in seconds */ +#define DEFAULT_COMMAND_TIMEOUT 4 + +#define CPT_COUNT_THOLD 32 +#define CPT_TIMER_THOLD 0x3F -#define AE_TYPE 1 -#define SE_TYPE 2 +#ifndef ROUNDUP4 +#define ROUNDUP4(val) (((val) + 3) & 0xfffffffc) +#endif -struct cptvf_meta_info { - void *cptvf_meta_pool; - int cptvf_op_mlen; - int cptvf_op_sb_mlen; +#ifndef ROUNDUP8 +#define ROUNDUP8(val) (((val) + 7) & 0xfffffff8) +#endif + +#ifndef ROUNDUP16 +#define ROUNDUP16(val) (((val) + 15) & 0xfffffff0) +#endif + +#define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++) + +struct cpt_qp_meta_info { + struct rte_mempool *pool; + int sg_mlen; + int lb_mlen; }; struct rid { @@ -34,14 +49,33 @@ struct rid { * */ struct pending_queue { + /** Pending requests count */ + uint64_t pending_count; + /** Array of pending requests */ + struct rid *rid_queue; /** Tail of queue to be used for enqueue */ uint16_t enq_tail; /** Head of queue to be used for dequeue */ uint16_t deq_head; - /** Array of pending requests */ - struct rid *rid_queue; - /** Pending requests count */ - uint64_t pending_count; }; +struct cpt_request_info { + /** Data path fields */ + uint64_t comp_baddr; + volatile uint64_t *completion_addr; + volatile uint64_t *alternate_caddr; + void *op; + struct { + uint64_t ei0; + uint64_t ei1; + uint64_t ei2; + uint64_t ei3; + } ist; + uint8_t *rptr; + + /** Control path fields */ + uint64_t time_out; + uint8_t extra_time; +} __rte_aligned(8); + #endif /* _CPT_COMMON_H_ */