f-stack/dpdk/drivers/common/cpt/cpt_common.h

65 lines
1.2 KiB
C
Raw Normal View History

2019-06-25 11:12:58 +00:00
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2018 Cavium, Inc
*/
#ifndef _CPT_COMMON_H_
#define _CPT_COMMON_H_
2020-06-18 16:55:50 +00:00
#include <rte_mempool.h>
2019-06-25 11:12:58 +00:00
/*
2020-06-18 16:55:50 +00:00
* This file defines common macros and structs
2019-06-25 11:12:58 +00:00
*/
#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 MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++)
2020-06-18 16:55:50 +00:00
struct cpt_qp_meta_info {
struct rte_mempool *pool;
int sg_mlen;
int lb_mlen;
2019-06-25 11:12:58 +00:00
};
/*
* Pending queue structure
*
*/
struct pending_queue {
2020-06-18 16:55:50 +00:00
/** Pending requests count */
uint64_t pending_count;
/** Array of pending requests */
2021-02-05 08:48:47 +00:00
uintptr_t *req_queue;
2019-06-25 11:12:58 +00:00
/** Tail of queue to be used for enqueue */
uint16_t enq_tail;
/** Head of queue to be used for dequeue */
uint16_t deq_head;
};
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;
} ist;
2020-06-18 16:55:50 +00:00
uint8_t *rptr;
2021-02-05 08:48:47 +00:00
const struct otx2_cpt_qp *qp;
2019-06-25 11:12:58 +00:00
/** Control path fields */
uint64_t time_out;
uint8_t extra_time;
2021-02-05 08:48:47 +00:00
} __rte_aligned(8);
2019-06-25 11:12:58 +00:00
#endif /* _CPT_COMMON_H_ */