1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3 
4 #ifndef __MLX5_EN_POST_METER_H__
5 #define __MLX5_EN_POST_METER_H__
6 
7 #define packet_color_to_reg { \
8 	.mfield = MLX5_ACTION_IN_FIELD_METADATA_REG_C_5, \
9 	.moffset = 0, \
10 	.mlen = 8, \
11 	.soffset = MLX5_BYTE_OFF(fte_match_param, \
12 				 misc_parameters_2.metadata_reg_c_5), \
13 }
14 
15 struct mlx5e_post_meter_priv;
16 
17 struct mlx5_flow_table *
18 mlx5e_post_meter_get_ft(struct mlx5e_post_meter_priv *post_meter);
19 
20 struct mlx5e_post_meter_priv *
21 mlx5e_post_meter_init(struct mlx5e_priv *priv,
22 		      enum mlx5_flow_namespace_type ns_type,
23 		      struct mlx5e_post_act *post_act,
24 		      struct mlx5_fc *green_counter,
25 		      struct mlx5_fc *red_counter);
26 void
27 mlx5e_post_meter_cleanup(struct mlx5e_post_meter_priv *post_meter);
28 
29 #endif /* __MLX5_EN_POST_METER_H__ */
30