net/ice/base: add accessors to get/set time reference
[dpdk.git] / drivers / event / dlb2 / rte_pmd_dlb2.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4
5 /*!
6  *  @file      rte_pmd_dlb2.h
7  *
8  *  @brief     DLB PMD-specific functions
9  */
10
11 #ifndef _RTE_PMD_DLB2_H_
12 #define _RTE_PMD_DLB2_H_
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 #include <stdint.h>
19
20 /**
21  * @warning
22  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
23  *
24  * Selects the token pop mode for a DLB2 port.
25  */
26 enum dlb2_token_pop_mode {
27         /* Pop the CQ tokens immediately after dequeueing. */
28         AUTO_POP,
29         /* Pop CQ tokens after (dequeue_depth - 1) events are released.
30          * Supported on load-balanced ports only.
31          */
32         DELAYED_POP,
33         /* Pop the CQ tokens during next dequeue operation. */
34         DEFERRED_POP,
35
36         /* NUM_TOKEN_POP_MODES must be last */
37         NUM_TOKEN_POP_MODES
38 };
39
40 /*!
41  * @warning
42  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
43  *
44  * Configure the token pop mode for a DLB2 port. By default, all ports use
45  * AUTO_POP. This function must be called before calling rte_event_port_setup()
46  * for the port, but after calling rte_event_dev_configure().
47  *
48  * @param dev_id
49  *    The identifier of the event device.
50  * @param port_id
51  *    The identifier of the event port.
52  * @param mode
53  *    The token pop mode.
54  *
55  * @return
56  * - 0: Success
57  * - EINVAL: Invalid dev_id, port_id, or mode
58  * - EINVAL: The DLB2 is not configured, is already running, or the port is
59  *   already setup
60  */
61
62 __rte_experimental
63 int
64 rte_pmd_dlb2_set_token_pop_mode(uint8_t dev_id,
65                                 uint8_t port_id,
66                                 enum dlb2_token_pop_mode mode);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif /* _RTE_PMD_DLB2_H_ */