DPDK  24.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 #include <sys/types.h>
51 
52 #include <rte_compat.h>
53 
54 #include "rte_swx_hash_func.h"
55 
57 #ifndef RTE_SWX_TABLE_LEARNER_N_KEY_TIMEOUTS_MAX
58 #define RTE_SWX_TABLE_LEARNER_N_KEY_TIMEOUTS_MAX 16
59 #endif
60 
64  uint32_t key_size;
65 
67  uint32_t key_offset;
68 
76  uint8_t *key_mask0;
77 
81  uint32_t action_data_size;
82 
86 
88  uint32_t n_keys_max;
89 
94  uint32_t *key_timeout;
95 
99  uint32_t n_key_timeouts;
100 };
101 
110 __rte_experimental
111 uint64_t
113 
124 __rte_experimental
125 uint64_t
127 
138 __rte_experimental
139 void *
140 rte_swx_table_learner_create(struct rte_swx_table_learner_params *params, int numa_node);
141 
155 __rte_experimental
156 int
158  uint32_t key_timeout_id,
159  uint32_t key_timeout);
160 
209 __rte_experimental
210 int
211 rte_swx_table_learner_lookup(void *table,
212  void *mailbox,
213  uint64_t time,
214  uint8_t **key,
215  uint64_t *action_id,
216  uint8_t **action_data,
217  size_t *entry_id,
218  int *hit);
219 
242 __rte_experimental
243 uint32_t
244 rte_swx_table_learner_add(void *table,
245  void *mailbox,
246  uint64_t time,
247  uint64_t action_id,
248  uint8_t *action_data,
249  uint32_t key_timeout_id);
250 
264 __rte_experimental
265 void
266 rte_swx_table_learner_rearm(void *table,
267  void *mailbox,
268  uint64_t time);
269 
285 __rte_experimental
286 void
288  void *mailbox,
289  uint64_t time,
290  uint32_t key_timeout_id);
291 
304 __rte_experimental
305 void
306 rte_swx_table_learner_delete(void *table,
307  void *mailbox);
308 
315 __rte_experimental
316 void
317 rte_swx_table_learner_free(void *table);
318 
319 #ifdef __cplusplus
320 }
321 #endif
322 
323 #endif
__rte_experimental int rte_swx_table_learner_timeout_update(void *table, uint32_t key_timeout_id, uint32_t key_timeout)
uint32_t(* rte_swx_hash_func_t)(const void *key, uint32_t length, uint32_t seed)
__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 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 int rte_swx_table_learner_lookup(void *table, void *mailbox, uint64_t time, uint8_t **key, uint64_t *action_id, uint8_t **action_data, size_t *entry_id, int *hit)
__rte_experimental void rte_swx_table_learner_rearm(void *table, void *mailbox, uint64_t time)