1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2021 HiSilicon Limited
5 #ifndef SKELETON_DMADEV_H
6 #define SKELETON_DMADEV_H
12 #define SKELDMA_ARG_LCORE "lcore"
18 uint16_t ridx; /* ring idx */
22 int lcore_id; /* cpucopy task affinity core */
24 pthread_t thread; /* cpucopy task thread */
25 volatile int exit_flag; /* cpucopy task exit flag */
27 struct skeldma_desc *desc_mem;
29 /* Descriptor ring state machine:
31 * ----------- enqueue without submit -----------
32 * | empty |------------------------------->| pending |
33 * -----------\ -----------
35 * | | |submit doorbell
37 * | |enqueue with submit |
38 * |get completed |------------------| |
41 * ----------- cpucopy thread working -----------
42 * |completed|<-------------------------------| running |
43 * ----------- -----------
45 struct rte_ring *desc_empty;
46 struct rte_ring *desc_pending;
47 struct rte_ring *desc_running;
48 struct rte_ring *desc_completed;
50 /* Cache delimiter for dataplane API's operation data */
51 char cache1 __rte_cache_aligned;
52 uint16_t ridx; /* ring idx */
53 uint64_t submitted_count;
55 /* Cache delimiter for cpucopy thread's operation data */
56 char cache2 __rte_cache_aligned;
57 volatile uint32_t zero_req_count;
58 uint64_t completed_count;
61 #endif /* SKELETON_DMADEV_H */