2b0a3d7126ef75789af1b4ce845a9f189ec44509
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_template_struct.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2014-2019 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _ULP_TEMPLATE_STRUCT_H_
7 #define _ULP_TEMPLATE_STRUCT_H_
8
9 #include <stdint.h>
10 #include "rte_ether.h"
11 #include "rte_icmp.h"
12 #include "rte_ip.h"
13 #include "rte_tcp.h"
14 #include "rte_udp.h"
15 #include "rte_esp.h"
16 #include "rte_sctp.h"
17 #include "rte_flow.h"
18 #include "tf_core.h"
19
20 /*
21  * structure to hold the action property details
22  * It is a array of 128 bytes
23  */
24 struct ulp_rte_act_prop {
25         uint8_t act_details[BNXT_ULP_ACT_PROP_IDX_LAST];
26 };
27
28 /* Device specific parameters */
29 struct bnxt_ulp_device_params {
30         uint8_t                         description[16];
31         uint32_t                        global_fid_enable;
32         enum bnxt_ulp_byte_order        byte_order;
33         uint8_t                         encap_byte_swap;
34         uint32_t                        lfid_entries;
35         uint32_t                        lfid_entry_size;
36         uint64_t                        gfid_entries;
37         uint32_t                        gfid_entry_size;
38         uint64_t                        num_flows;
39         uint32_t                        num_resources_per_flow;
40 };
41
42 struct bnxt_ulp_mapper_act_tbl_info {
43         enum bnxt_ulp_resource_func     resource_func;
44         enum tf_tbl_type table_type;
45         uint8_t         direction;
46         uint8_t         srch_b4_alloc;
47         uint32_t        result_start_idx;
48         uint16_t        result_bit_size;
49         uint16_t        encap_num_fields;
50         uint16_t        result_num_fields;
51
52         enum bnxt_ulp_regfile_index     regfile_wr_idx;
53 };
54
55 struct bnxt_ulp_mapper_result_field_info {
56         uint8_t                         name[64];
57         enum bnxt_ulp_result_opc        result_opcode;
58         uint16_t                        field_bit_size;
59         uint8_t                         result_operand[16];
60 };
61
62 /*
63  * The ulp_device_params is indexed by the dev_id
64  * This table maintains the device specific parameters
65  */
66 extern struct bnxt_ulp_device_params ulp_device_params[];
67
68 /*
69  * The ulp_data_field_list provides the instructions for creating an action
70  * record.  It uses the same structure as the result list, but is only used for
71  * actions.
72  */
73 extern
74 struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[];
75
76 /*
77  * The ulp_act_prop_map_table provides the mapping to index and size of action
78  * properties.
79  */
80 extern uint32_t ulp_act_prop_map_table[];
81
82 #endif /* _ULP_TEMPLATE_STRUCT_H_ */