summaryrefslogtreecommitdiff
path: root/lib/librte_table/rte_table_array.h
blob: b16c5dfe5b1c857d50838e2a95986840e9ada755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2010-2014 Intel Corporation
 */

#ifndef __INCLUDE_RTE_TABLE_ARRAY_H__
#define __INCLUDE_RTE_TABLE_ARRAY_H__

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @file
 * RTE Table Array
 *
 * Simple array indexing. Lookup key is the array entry index.
 *
 ***/

#include <stdint.h>

#include "rte_table.h"

/** Array table parameters */
struct rte_table_array_params {
	/** Number of array entries. Has to be a power of two. */
	uint32_t n_entries;

	/** Byte offset within input packet meta-data where lookup key (i.e. the
	    array entry index) is located. */
	uint32_t offset;
};

/** Array table key format */
struct rte_table_array_key {
	/** Array entry index */
	uint32_t pos;
};

/** Array table operations */
extern struct rte_table_ops rte_table_array_ops;

#ifdef __cplusplus
}
#endif

#endif