4 * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef __INCLUDE_PIPELINE_FLOW_ACTIONS_BE_H__
35 #define __INCLUDE_PIPELINE_FLOW_ACTIONS_BE_H__
37 #include <rte_meter.h>
39 #include "pipeline_common_be.h"
41 #ifndef PIPELINE_FA_N_TC_MAX
42 #define PIPELINE_FA_N_TC_MAX 4
45 #define PIPELINE_FA_N_DSCP 64
47 struct pipeline_fa_params
{
49 uint32_t n_meters_per_flow
;
50 uint32_t flow_id_offset
;
51 uint32_t ip_hdr_offset
;
52 uint32_t color_offset
;
53 uint32_t dscp_enabled
;
57 pipeline_fa_parse_args(struct pipeline_fa_params
*p
,
58 struct pipeline_params
*params
);
60 struct pipeline_fa_policer_action
{
62 enum rte_meter_color color
;
65 struct pipeline_fa_policer_params
{
66 struct pipeline_fa_policer_action action
[e_RTE_METER_COLORS
];
69 struct pipeline_fa_flow_params
{
70 struct rte_meter_trtcm_params m
[PIPELINE_FA_N_TC_MAX
];
71 struct pipeline_fa_policer_params p
[PIPELINE_FA_N_TC_MAX
];
76 pipeline_fa_flow_params_set_default(struct pipeline_fa_flow_params
*params
);
78 struct pipeline_fa_policer_stats
{
79 uint64_t n_pkts
[e_RTE_METER_COLORS
];
83 enum pipeline_fa_msg_req_type
{
84 PIPELINE_FA_MSG_REQ_FLOW_CONFIG
= 0,
85 PIPELINE_FA_MSG_REQ_FLOW_CONFIG_BULK
,
86 PIPELINE_FA_MSG_REQ_DSCP_CONFIG
,
87 PIPELINE_FA_MSG_REQ_POLICER_STATS_READ
,
94 struct pipeline_fa_flow_config_msg_req
{
95 enum pipeline_msg_req_type type
;
96 enum pipeline_fa_msg_req_type subtype
;
101 uint32_t meter_update_mask
;
102 uint32_t policer_update_mask
;
103 uint32_t port_update
;
104 struct pipeline_fa_flow_params params
;
107 struct pipeline_fa_flow_config_msg_rsp
{
113 * MSG FLOW CONFIG BULK
115 struct pipeline_fa_flow_config_bulk_msg_req
{
116 enum pipeline_msg_req_type type
;
117 enum pipeline_fa_msg_req_type subtype
;
123 uint32_t meter_update_mask
;
124 uint32_t policer_update_mask
;
125 uint32_t port_update
;
126 struct pipeline_fa_flow_params
*params
;
129 struct pipeline_fa_flow_config_bulk_msg_rsp
{
136 struct pipeline_fa_dscp_config_msg_req
{
137 enum pipeline_msg_req_type type
;
138 enum pipeline_fa_msg_req_type subtype
;
141 uint32_t traffic_class
;
142 enum rte_meter_color color
;
145 struct pipeline_fa_dscp_config_msg_rsp
{
150 * MSG POLICER STATS READ
152 struct pipeline_fa_policer_stats_msg_req
{
153 enum pipeline_msg_req_type type
;
154 enum pipeline_fa_msg_req_type subtype
;
161 struct pipeline_fa_policer_stats_msg_rsp
{
163 struct pipeline_fa_policer_stats stats
;
166 extern struct pipeline_be_ops pipeline_flow_actions_be_ops
;