New upstream version 18.02
[deb_dpdk.git] / examples / ip_pipeline / pipeline / pipeline_flow_classification_be.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2015 Intel Corporation
3  */
4
5 #ifndef __INCLUDE_PIPELINE_FLOW_CLASSIFICATION_BE_H__
6 #define __INCLUDE_PIPELINE_FLOW_CLASSIFICATION_BE_H__
7
8 #include "pipeline_common_be.h"
9
10 enum pipeline_fc_msg_req_type {
11         PIPELINE_FC_MSG_REQ_FLOW_ADD = 0,
12         PIPELINE_FC_MSG_REQ_FLOW_ADD_BULK,
13         PIPELINE_FC_MSG_REQ_FLOW_DEL,
14         PIPELINE_FC_MSG_REQ_FLOW_ADD_DEFAULT,
15         PIPELINE_FC_MSG_REQ_FLOW_DEL_DEFAULT,
16         PIPELINE_FC_MSG_REQS,
17 };
18
19 #ifndef PIPELINE_FC_FLOW_KEY_MAX_SIZE
20 #define PIPELINE_FC_FLOW_KEY_MAX_SIZE            64
21 #endif
22
23 /*
24  * MSG ADD
25  */
26 struct pipeline_fc_add_msg_req {
27         enum pipeline_msg_req_type type;
28         enum pipeline_fc_msg_req_type subtype;
29
30         uint8_t key[PIPELINE_FC_FLOW_KEY_MAX_SIZE];
31
32         uint32_t port_id;
33         uint32_t flow_id;
34 };
35
36 struct pipeline_fc_add_msg_rsp {
37         int status;
38         int key_found;
39         void *entry_ptr;
40 };
41
42 /*
43  * MSG ADD BULK
44  */
45 struct pipeline_fc_add_bulk_flow_req {
46         uint8_t key[PIPELINE_FC_FLOW_KEY_MAX_SIZE];
47         uint32_t port_id;
48         uint32_t flow_id;
49 };
50
51 struct pipeline_fc_add_bulk_flow_rsp {
52         int key_found;
53         void *entry_ptr;
54 };
55
56 struct pipeline_fc_add_bulk_msg_req {
57         enum pipeline_msg_req_type type;
58         enum pipeline_fc_msg_req_type subtype;
59
60         struct pipeline_fc_add_bulk_flow_req *req;
61         struct pipeline_fc_add_bulk_flow_rsp *rsp;
62         uint32_t n_keys;
63 };
64
65 struct pipeline_fc_add_bulk_msg_rsp {
66         uint32_t n_keys;
67 };
68
69 /*
70  * MSG DEL
71  */
72 struct pipeline_fc_del_msg_req {
73         enum pipeline_msg_req_type type;
74         enum pipeline_fc_msg_req_type subtype;
75
76         uint8_t key[PIPELINE_FC_FLOW_KEY_MAX_SIZE];
77 };
78
79 struct pipeline_fc_del_msg_rsp {
80         int status;
81         int key_found;
82 };
83
84 /*
85  * MSG ADD DEFAULT
86  */
87 struct pipeline_fc_add_default_msg_req {
88         enum pipeline_msg_req_type type;
89         enum pipeline_fc_msg_req_type subtype;
90
91         uint32_t port_id;
92 };
93
94 struct pipeline_fc_add_default_msg_rsp {
95         int status;
96         void *entry_ptr;
97 };
98
99 /*
100  * MSG DEL DEFAULT
101  */
102 struct pipeline_fc_del_default_msg_req {
103         enum pipeline_msg_req_type type;
104         enum pipeline_fc_msg_req_type subtype;
105 };
106
107 struct pipeline_fc_del_default_msg_rsp {
108         int status;
109 };
110
111 extern struct pipeline_be_ops pipeline_flow_classification_be_ops;
112
113 #endif