DPDK  22.07.0
rte_swx_table_learner.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2021 Intel Corporation
3  */
4 #ifndef __INCLUDE_RTE_SWX_TABLE_LEARNER_H__
5 #define __INCLUDE_RTE_SWX_TABLE_LEARNER_H__
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
49 #include <stdint.h>
50 
51 #include <rte_compat.h>
52 
54 #ifndef RTE_SWX_TABLE_LEARNER_N_KEY_TIMEOUTS_MAX
55 #define RTE_SWX_TABLE_LEARNER_N_KEY_TIMEOUTS_MAX 16
56 #endif
57 
61  uint32_t key_size;
62 
64  uint32_t key_offset;
65 
73  uint8_t *key_mask0;
74 
78  uint32_t action_data_size;
79 
81  uint32_t n_keys_max;
82 
87  uint32_t *key_timeout;
88 
92  uint32_t n_key_timeouts;
93 };
94 
103 __rte_experimental
104 uint64_t
106 
117 __rte_experimental
118 uint64_t
120 
131 __rte_experimental
132 void *
133 rte_swx_table_learner_create(struct rte_swx_table_learner_params *params, int numa_node);
134 
148 __rte_experimental
149 int
151  uint32_t key_timeout_id,
152  uint32_t key_timeout);
153 
191 __rte_experimental
192 int
193 rte_swx_table_learner_lookup(void *table,
194  void *mailbox,
195  uint64_t time,
196  uint8_t **key,
197  uint64_t *action_id,
198  uint8_t **action_data,
199  int *hit);
200 
223 __rte_experimental
224 uint32_t
225 rte_swx_table_learner_add(void *table,
226  void *mailbox,
227  uint64_t time,
228  uint64_t action_id,
229  uint8_t *action_data,
230  uint32_t key_timeout_id);
231 
245 __rte_experimental
246 void
247 rte_swx_table_learner_rearm(void *table,
248  void *mailbox,
249  uint64_t time);
250 
266 __rte_experimental
267 void
269  void *mailbox,
270  uint64_t time,
271  uint32_t key_timeout_id);
272 
285 __rte_experimental
286 void
287 rte_swx_table_learner_delete(void *table,
288  void *mailbox);
289 
296 __rte_experimental
297 void
298 rte_swx_table_learner_free(void *table);
299 
300 #ifdef __cplusplus
301 }
302 #endif
303 
304 #endif
__rte_experimental int rte_swx_table_learner_timeout_update(void *table, uint32_t key_timeout_id, uint32_t key_timeout)
__rte_experimental uint64_t rte_swx_table_learner_mailbox_size_get(void)
__rte_experimental void rte_swx_table_learner_delete(void *table, void *mailbox)
__rte_experimental void * rte_swx_table_learner_create(struct rte_swx_table_learner_params *params, int numa_node)
__rte_experimental void rte_swx_table_learner_free(void *table)
__rte_experimental int rte_swx_table_learner_lookup(void *table, void *mailbox, uint64_t time, uint8_t **key, uint64_t *action_id, uint8_t **action_data, int *hit)
__rte_experimental void rte_swx_table_learner_rearm_new(void *table, void *mailbox, uint64_t time, uint32_t key_timeout_id)
__rte_experimental uint32_t rte_swx_table_learner_add(void *table, void *mailbox, uint64_t time, uint64_t action_id, uint8_t *action_data, uint32_t key_timeout_id)
__rte_experimental uint64_t rte_swx_table_learner_footprint_get(struct rte_swx_table_learner_params *params)
__rte_experimental void rte_swx_table_learner_rearm(void *table, void *mailbox, uint64_t time)