DPDK 25.03.0-rc0
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
58
64
68 uint32_t n_keys_max;
69};
70
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
119RTE_TAILQ_HEAD(rte_swx_table_entry_list, rte_swx_table_entry);
120
133typedef uint64_t
135 struct rte_swx_table_entry_list *entries,
136 const char *args);
137
148typedef uint64_t
150
165typedef 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
183typedef int
184(*rte_swx_table_add_t)(void *table,
185 struct rte_swx_table_entry *entry);
186
200typedef int
201(*rte_swx_table_delete_t)(void *table,
202 struct rte_swx_table_entry *entry);
203
265typedef 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
280typedef 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_match_type
Definition: rte_swx_table.h:21
@ RTE_SWX_TABLE_MATCH_WILDCARD
Definition: rte_swx_table.h:23
@ RTE_SWX_TABLE_MATCH_EXACT
Definition: rte_swx_table.h:29
@ RTE_SWX_TABLE_MATCH_LPM
Definition: rte_swx_table.h:26
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)
int(* rte_swx_table_add_t)(void *table, struct rte_swx_table_entry *entry)
void(* rte_swx_table_free_t)(void *table)
int(* rte_swx_table_delete_t)(void *table, struct rte_swx_table_entry *entry)
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)
uint64_t(* rte_swx_table_mailbox_size_get_t)(void)
RTE_TAILQ_HEAD(rte_swx_table_entry_list, rte_swx_table_entry)
uint64_t(* rte_swx_table_footprint_get_t)(struct rte_swx_table_params *params, struct rte_swx_table_entry_list *entries, const char *args)
Definition: rte_swx_table.h:72
uint32_t key_priority
uint8_t * key
Definition: rte_swx_table.h:81
uint8_t * key_mask
Definition: rte_swx_table.h:88
uint8_t * action_data
uint64_t key_signature
Definition: rte_swx_table.h:95
RTE_TAILQ_ENTRY(rte_swx_table_entry) node
uint64_t action_id
rte_swx_table_lookup_t lkp
rte_swx_table_delete_t del
rte_swx_table_mailbox_size_get_t mailbox_size_get
rte_swx_table_footprint_get_t footprint_get
rte_swx_table_add_t add
rte_swx_table_free_t free
rte_swx_table_create_t create
enum rte_swx_table_match_type match_type
Definition: rte_swx_table.h:35
rte_swx_hash_func_t hash_func
Definition: rte_swx_table.h:63