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