xref: /dpdk/lib/table/rte_table_array.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
5 #ifndef __INCLUDE_RTE_TABLE_ARRAY_H__
6 #define __INCLUDE_RTE_TABLE_ARRAY_H__
7 
8 /**
9  * @file
10  * RTE Table Array
11  *
12  * Simple array indexing. Lookup key is the array entry index.
13  */
14 
15 #include <stdint.h>
16 
17 #include "rte_table.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /** Array table parameters */
24 struct rte_table_array_params {
25 	/** Number of array entries. Has to be a power of two. */
26 	uint32_t n_entries;
27 
28 	/** Byte offset within input packet meta-data where lookup key (i.e. the
29 	    array entry index) is located. */
30 	uint32_t offset;
31 };
32 
33 /** Array table key format */
34 struct rte_table_array_key {
35 	/** Array entry index */
36 	uint32_t pos;
37 };
38 
39 /** Array table operations */
40 extern struct rte_table_ops rte_table_array_ops;
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif
47