DPDK  23.07.0
rte_swx_table.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4 #ifndef __INCLUDE_RTE_SWX_TABLE_H__
5 #define __INCLUDE_RTE_SWX_TABLE_H__
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
18 #include <stdint.h>
19 
20 #include <rte_os.h>
21 
22 #include "rte_swx_hash_func.h"
23 
28 
31 
34 };
35 
40 
42  uint32_t key_size;
43 
45  uint32_t key_offset;
46 
55  uint8_t *key_mask0;
56 
61  uint32_t action_data_size;
62 
68 
72  uint32_t n_keys_max;
73 };
74 
80  RTE_TAILQ_ENTRY(rte_swx_table_entry) node;
81 
85  uint8_t *key;
86 
92  uint8_t *key_mask;
93 
99  uint64_t key_signature;
100 
108  uint32_t key_priority;
109 
111  uint64_t action_id;
112 
119  uint8_t *action_data;
120 };
121 
123 RTE_TAILQ_HEAD(rte_swx_table_entry_list, rte_swx_table_entry);
124 
137 typedef uint64_t
139  struct rte_swx_table_entry_list *entries,
140  const char *args);
141 
152 typedef uint64_t
154 
169 typedef void *
170 (*rte_swx_table_create_t)(struct rte_swx_table_params *params,
171  struct rte_swx_table_entry_list *entries,
172  const char *args,
173  int numa_node);
174 
187 typedef int
188 (*rte_swx_table_add_t)(void *table,
189  struct rte_swx_table_entry *entry);
190 
204 typedef int
205 (*rte_swx_table_delete_t)(void *table,
206  struct rte_swx_table_entry *entry);
207 
269 typedef int
270 (*rte_swx_table_lookup_t)(void *table,
271  void *mailbox,
272  uint8_t **key,
273  uint64_t *action_id,
274  uint8_t **action_data,
275  size_t *entry_id,
276  int *hit);
277 
284 typedef void
285 (*rte_swx_table_free_t)(void *table);
286 
291 
294 
297 
303 
309 
312 
315 };
316 
317 #ifdef __cplusplus
318 }
319 #endif
320 
321 #endif
uint32_t(* rte_swx_hash_func_t)(const void *key, uint32_t length, uint32_t seed)
rte_swx_table_mailbox_size_get_t mailbox_size_get
int(* rte_swx_table_lookup_t)(void *table, void *mailbox, uint8_t **key, uint64_t *action_id, uint8_t **action_data, size_t *entry_id, int *hit)
rte_swx_table_create_t create
uint8_t * key_mask
Definition: rte_swx_table.h:92
uint32_t key_priority
Definition: rte_swx_table.h:76
rte_swx_table_add_t add
enum rte_swx_table_match_type match_type
Definition: rte_swx_table.h:39
rte_swx_table_lookup_t lkp
int(* rte_swx_table_delete_t)(void *table, struct rte_swx_table_entry *entry)
rte_swx_table_match_type
Definition: rte_swx_table.h:25
uint64_t key_signature
Definition: rte_swx_table.h:99
rte_swx_hash_func_t hash_func
Definition: rte_swx_table.h:67
RTE_TAILQ_HEAD(rte_swx_table_entry_list, rte_swx_table_entry)
void(* rte_swx_table_free_t)(void *table)
void *(* rte_swx_table_create_t)(struct rte_swx_table_params *params, struct rte_swx_table_entry_list *entries, const char *args, int numa_node)
rte_swx_table_footprint_get_t footprint_get
uint64_t action_id
uint64_t(* rte_swx_table_footprint_get_t)(struct rte_swx_table_params *params, struct rte_swx_table_entry_list *entries, const char *args)
uint8_t * key
Definition: rte_swx_table.h:85
uint64_t(* rte_swx_table_mailbox_size_get_t)(void)
int(* rte_swx_table_add_t)(void *table, struct rte_swx_table_entry *entry)
uint8_t * action_data
rte_swx_table_free_t free
rte_swx_table_delete_t del