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 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 /** 13 * @file 14 * RTE Table Array 15 * 16 * Simple array indexing. Lookup key is the array entry index. 17 * 18 ***/ 19 20 #include <stdint.h> 21 22 #include "rte_table.h" 23 24 /** Array table parameters */ 25 struct rte_table_array_params { 26 /** Number of array entries. Has to be a power of two. */ 27 uint32_t n_entries; 28 29 /** Byte offset within input packet meta-data where lookup key (i.e. the 30 array entry index) is located. */ 31 uint32_t offset; 32 }; 33 34 /** Array table key format */ 35 struct rte_table_array_key { 36 /** Array entry index */ 37 uint32_t pos; 38 }; 39 40 /** Array table operations */ 41 extern struct rte_table_ops rte_table_array_ops; 42 43 #ifdef __cplusplus 44 } 45 #endif 46 47 #endif 48