1 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
2 // Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 
4 #include "act.h"
5 #include "en/tc_priv.h"
6 
7 static bool
8 tc_act_can_offload_drop(struct mlx5e_tc_act_parse_state *parse_state,
9 			const struct flow_action_entry *act,
10 			int act_index)
11 {
12 	return true;
13 }
14 
15 static int
16 tc_act_parse_drop(struct mlx5e_tc_act_parse_state *parse_state,
17 		  const struct flow_action_entry *act,
18 		  struct mlx5e_priv *priv,
19 		  struct mlx5_flow_attr *attr)
20 {
21 	attr->action |= MLX5_FLOW_CONTEXT_ACTION_DROP |
22 			MLX5_FLOW_CONTEXT_ACTION_COUNT;
23 
24 	return 0;
25 }
26 
27 struct mlx5e_tc_act mlx5e_tc_act_drop = {
28 	.can_offload = tc_act_can_offload_drop,
29 	.parse_action = tc_act_parse_drop,
30 };
31