xref: /dpdk/drivers/net/sfc/sfc_tbl_meta.h (revision bc712f1c86fc9c2bb5bb41a80e12f34e224f4c6d)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright (c) 2023 Advanced Micro Devices, Inc.
4  */
5 
6 #ifndef _SFC_TBL_META_H
7 #define _SFC_TBL_META_H
8 
9 #include <rte_hash.h>
10 
11 #include "efx.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /* Metadata about table layout */
18 struct sfc_tbl_meta {
19 	efx_table_id_t			table_id;
20 	efx_table_descriptor_t		descriptor;
21 	efx_table_field_descriptor_t	*keys;
22 	efx_table_field_descriptor_t	*responses;
23 };
24 
25 struct sfc_tbl_meta_cache {
26 	struct rte_hash	*cache;
27 };
28 
29 struct sfc_adapter;
30 
31 const struct sfc_tbl_meta *sfc_tbl_meta_lookup(struct sfc_adapter *sa,
32 					       efx_table_id_t table_id);
33 
34 int sfc_tbl_meta_init(struct sfc_adapter *sa);
35 void sfc_tbl_meta_fini(struct sfc_adapter *sa);
36 
37 #endif /* _SFC_TBL_META_H */
38