3a7845d59ea35db90d17a0fdf09ff8e1134e566e
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_rte_parser.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2014-2020 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _ULP_RTE_PARSER_H_
7 #define _ULP_RTE_PARSER_H_
8
9 #include <rte_log.h>
10 #include <rte_flow.h>
11 #include <rte_flow_driver.h>
12 #include "ulp_template_db.h"
13 #include "ulp_template_struct.h"
14
15 /*
16  * Function to handle the parsing of RTE Flows and placing
17  * the RTE flow items into the ulp structures.
18  */
19 int32_t
20 bnxt_ulp_rte_parser_hdr_parse(const struct rte_flow_item pattern[],
21                               struct ulp_rte_hdr_bitmap *hdr_bitmap,
22                               struct ulp_rte_hdr_field  *hdr_field);
23
24 /* Function to handle the parsing of RTE Flow item PF Header. */
25 int32_t
26 ulp_rte_pf_hdr_handler(const struct rte_flow_item       *item,
27                        struct ulp_rte_hdr_bitmap        *hdr_bitmap,
28                        struct ulp_rte_hdr_field         *hdr_field,
29                        uint32_t                         *field_idx,
30                        uint32_t                         *vlan_idx);
31
32 /* Function to handle the parsing of RTE Flow item VF Header. */
33 int32_t
34 ulp_rte_vf_hdr_handler(const struct rte_flow_item       *item,
35                        struct ulp_rte_hdr_bitmap        *hdr_bitmap,
36                        struct ulp_rte_hdr_field         *hdr_field,
37                        uint32_t                         *field_idx,
38                        uint32_t                         *vlan_idx);
39
40 /* Function to handle the parsing of RTE Flow item port id Header. */
41 int32_t
42 ulp_rte_port_id_hdr_handler(const struct rte_flow_item  *item,
43                             struct ulp_rte_hdr_bitmap   *hdr_bitmap,
44                             struct ulp_rte_hdr_field    *hdr_field,
45                             uint32_t                    *field_idx,
46                             uint32_t                    *vlan_idx);
47
48 /* Function to handle the parsing of RTE Flow item port id Header. */
49 int32_t
50 ulp_rte_phy_port_hdr_handler(const struct rte_flow_item *item,
51                              struct ulp_rte_hdr_bitmap  *hdr_bitmap,
52                              struct ulp_rte_hdr_field   *hdr_field,
53                              uint32_t                   *field_idx,
54                              uint32_t                   *vlan_idx);
55
56 /* Function to handle the RTE item Ethernet Header. */
57 int32_t
58 ulp_rte_eth_hdr_handler(const struct rte_flow_item      *item,
59                         struct ulp_rte_hdr_bitmap       *hdr_bitmap,
60                         struct ulp_rte_hdr_field        *hdr_field,
61                         uint32_t                        *field_idx,
62                         uint32_t                        *vlan_idx);
63
64 /* Function to handle the parsing of RTE Flow item Vlan Header. */
65 int32_t
66 ulp_rte_vlan_hdr_handler(const struct rte_flow_item     *item,
67                          struct ulp_rte_hdr_bitmap      *hdr_bitmap,
68                          struct ulp_rte_hdr_field       *hdr_field,
69                          uint32_t                       *field_idx,
70                          uint32_t                       *vlan_idx);
71
72 /* Function to handle the parsing of RTE Flow item IPV4 Header. */
73 int32_t
74 ulp_rte_ipv4_hdr_handler(const struct rte_flow_item     *item,
75                          struct ulp_rte_hdr_bitmap      *hdr_bitmap,
76                          struct ulp_rte_hdr_field       *hdr_field,
77                          uint32_t                       *field_idx,
78                          uint32_t                       *vlan_idx);
79
80 /* Function to handle the parsing of RTE Flow item IPV6 Header. */
81 int32_t
82 ulp_rte_ipv6_hdr_handler(const struct rte_flow_item     *item,
83                          struct ulp_rte_hdr_bitmap      *hdr_bitmap,
84                          struct ulp_rte_hdr_field       *hdr_field,
85                          uint32_t                       *field_idx,
86                          uint32_t                       *vlan_idx);
87
88 /* Function to handle the parsing of RTE Flow item UDP Header. */
89 int32_t
90 ulp_rte_udp_hdr_handler(const struct rte_flow_item      *item,
91                         struct ulp_rte_hdr_bitmap       *hdr_bitmap,
92                         struct ulp_rte_hdr_field        *hdr_field,
93                         uint32_t                        *field_idx,
94                         uint32_t                        *vlan_idx);
95
96 /* Function to handle the parsing of RTE Flow item TCP Header. */
97 int32_t
98 ulp_rte_tcp_hdr_handler(const struct rte_flow_item      *item,
99                         struct ulp_rte_hdr_bitmap       *hdr_bitmap,
100                         struct ulp_rte_hdr_field        *hdr_field,
101                         uint32_t                        *field_idx,
102                         uint32_t                        *vlan_idx);
103
104 /* Function to handle the parsing of RTE Flow item Vxlan Header. */
105 int32_t
106 ulp_rte_vxlan_hdr_handler(const struct rte_flow_item    *item,
107                           struct ulp_rte_hdr_bitmap     *hdrbitmap,
108                           struct ulp_rte_hdr_field      *hdr_field,
109                           uint32_t                      *field_idx,
110                           uint32_t                      *vlan_idx);
111
112 /* Function to handle the parsing of RTE Flow item void Header. */
113 int32_t
114 ulp_rte_void_hdr_handler(const struct rte_flow_item     *item,
115                          struct ulp_rte_hdr_bitmap      *hdr_bitmap,
116                          struct ulp_rte_hdr_field       *hdr_field,
117                          uint32_t                       *field_idx,
118                          uint32_t                       *vlan_idx);
119
120 #endif /* _ULP_RTE_PARSER_H_ */