xref: /dpdk/lib/table/rte_table_array.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
199a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
299a2dd95SBruce Richardson  * Copyright(c) 2010-2014 Intel Corporation
399a2dd95SBruce Richardson  */
499a2dd95SBruce Richardson 
599a2dd95SBruce Richardson #ifndef __INCLUDE_RTE_TABLE_ARRAY_H__
699a2dd95SBruce Richardson #define __INCLUDE_RTE_TABLE_ARRAY_H__
799a2dd95SBruce Richardson 
899a2dd95SBruce Richardson /**
999a2dd95SBruce Richardson  * @file
1099a2dd95SBruce Richardson  * RTE Table Array
1199a2dd95SBruce Richardson  *
1299a2dd95SBruce Richardson  * Simple array indexing. Lookup key is the array entry index.
133e4c5be9SThomas Monjalon  */
1499a2dd95SBruce Richardson 
1599a2dd95SBruce Richardson #include <stdint.h>
1699a2dd95SBruce Richardson 
1799a2dd95SBruce Richardson #include "rte_table.h"
1899a2dd95SBruce Richardson 
19*719834a6SMattias Rönnblom #ifdef __cplusplus
20*719834a6SMattias Rönnblom extern "C" {
21*719834a6SMattias Rönnblom #endif
22*719834a6SMattias Rönnblom 
2399a2dd95SBruce Richardson /** Array table parameters */
2499a2dd95SBruce Richardson struct rte_table_array_params {
2599a2dd95SBruce Richardson 	/** Number of array entries. Has to be a power of two. */
2699a2dd95SBruce Richardson 	uint32_t n_entries;
2799a2dd95SBruce Richardson 
2899a2dd95SBruce Richardson 	/** Byte offset within input packet meta-data where lookup key (i.e. the
2999a2dd95SBruce Richardson 	    array entry index) is located. */
3099a2dd95SBruce Richardson 	uint32_t offset;
3199a2dd95SBruce Richardson };
3299a2dd95SBruce Richardson 
3399a2dd95SBruce Richardson /** Array table key format */
3499a2dd95SBruce Richardson struct rte_table_array_key {
3599a2dd95SBruce Richardson 	/** Array entry index */
3699a2dd95SBruce Richardson 	uint32_t pos;
3799a2dd95SBruce Richardson };
3899a2dd95SBruce Richardson 
3999a2dd95SBruce Richardson /** Array table operations */
4099a2dd95SBruce Richardson extern struct rte_table_ops rte_table_array_ops;
4199a2dd95SBruce Richardson 
4299a2dd95SBruce Richardson #ifdef __cplusplus
4399a2dd95SBruce Richardson }
4499a2dd95SBruce Richardson #endif
4599a2dd95SBruce Richardson 
4699a2dd95SBruce Richardson #endif
47