net/ice/base: init parse graph CAM table for parser
[dpdk.git] / drivers / net / ice / base / ice_pg_cam.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2001-2021 Intel Corporation
3  */
4
5 #ifndef _ICE_PG_CAM_H_
6 #define _ICE_PG_CAM_H_
7
8 #define ICE_PG_CAM_TABLE_SIZE           2048
9 #define ICE_PG_SP_CAM_TABLE_SIZE        128
10 #define ICE_PG_NM_CAM_TABLE_SIZE        1024
11 #define ICE_PG_NM_SP_CAM_TABLE_SIZE     64
12
13 struct ice_pg_cam_key {
14         bool valid;
15         u16 node_id;
16         bool flag0;
17         bool flag1;
18         bool flag2;
19         bool flag3;
20         u8 boost_idx;
21         u16 alu_reg;
22         u32 next_proto;
23 };
24
25 struct ice_pg_nm_cam_key {
26         bool valid;
27         u16 node_id;
28         bool flag0;
29         bool flag1;
30         bool flag2;
31         bool flag3;
32         u8 boost_idx;
33         u16 alu_reg;
34 };
35
36 struct ice_pg_cam_action {
37         u16 next_node;
38         u8 next_pc;
39         bool is_pg;
40         u8 proto_id;
41         bool is_mg;
42         u8 marker_id;
43         bool is_last_round;
44         bool ho_polarity;
45         u16 ho_inc;
46 };
47
48 struct ice_pg_cam_item {
49         u16 idx;
50         struct ice_pg_cam_key key;
51         struct ice_pg_cam_action action;
52 };
53
54 struct ice_pg_nm_cam_item {
55         u16 idx;
56         struct ice_pg_nm_cam_key key;
57         struct ice_pg_cam_action action;
58 };
59
60 void ice_pg_cam_dump(struct ice_hw *hw, struct ice_pg_cam_item *item);
61 void ice_pg_nm_cam_dump(struct ice_hw *hw, struct ice_pg_nm_cam_item *item);
62
63 struct ice_pg_cam_item *ice_pg_cam_table_get(struct ice_hw *hw);
64 struct ice_pg_cam_item *ice_pg_sp_cam_table_get(struct ice_hw *hw);
65
66 struct ice_pg_nm_cam_item *ice_pg_nm_cam_table_get(struct ice_hw *hw);
67 struct ice_pg_nm_cam_item *ice_pg_nm_sp_cam_table_get(struct ice_hw *hw);
68 #endif /* _ICE_PG_CAM_H_ */