DPDK  24.11.0-rc1
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 
14 #include <stdint.h>
15 
16 #include <rte_os.h>
17 
18 #include "rte_swx_hash_func.h"
19 
24 
27 
30 };
31 
36 
38  uint32_t key_size;
39 
41  uint32_t key_offset;
42 
51  uint8_t *key_mask0;
52 
57  uint32_t action_data_size;
58 
64 
68  uint32_t n_keys_max;
69 };
70 
76  RTE_TAILQ_ENTRY(rte_swx_table_entry) node;
77 
81  uint8_t *key;
82 
88  uint8_t *key_mask;
89 
95  uint64_t key_signature;
96 
104  uint32_t key_priority;
105 
107  uint64_t action_id;
108 
115  uint8_t *action_data;
116 };
117 
119 RTE_TAILQ_HEAD(rte_swx_table_entry_list, rte_swx_table_entry);
120 
133 typedef uint64_t
135  struct rte_swx_table_entry_list *entries,
136  const char *args);
137 
148 typedef uint64_t
150 
165 typedef void *
166 (*rte_swx_table_create_t)(struct rte_swx_table_params *params,
167  struct rte_swx_table_entry_list *entries,
168  const char *args,
169  int numa_node);
170 
183 typedef int
184 (*rte_swx_table_add_t)(void *table,
185  struct rte_swx_table_entry *entry);
186 
200 typedef int
201 (*rte_swx_table_delete_t)(void *table,
202  struct rte_swx_table_entry *entry);
203 
265 typedef int
266 (*rte_swx_table_lookup_t)(void *table,
267  void *mailbox,
268  uint8_t **key,
269  uint64_t *action_id,
270  uint8_t **action_data,
271  size_t *entry_id,
272  int *hit);
273 
280 typedef void
281 (*rte_swx_table_free_t)(void *table);
282 
287 
290 
293 
299 
305 
308 
311 };
312 
313 #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:88
uint32_t key_priority
Definition: rte_swx_table.h:72
rte_swx_table_add_t add
enum rte_swx_table_match_type match_type
Definition: rte_swx_table.h:35
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:21
uint64_t key_signature
Definition: rte_swx_table.h:95
rte_swx_hash_func_t hash_func
Definition: rte_swx_table.h:63
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:81
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