xref: /linux/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/drop.c (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
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 int
tc_act_parse_drop(struct mlx5e_tc_act_parse_state * parse_state,const struct flow_action_entry * act,struct mlx5e_priv * priv,struct mlx5_flow_attr * attr)8 tc_act_parse_drop(struct mlx5e_tc_act_parse_state *parse_state,
9 		  const struct flow_action_entry *act,
10 		  struct mlx5e_priv *priv,
11 		  struct mlx5_flow_attr *attr)
12 {
13 	attr->action |= MLX5_FLOW_CONTEXT_ACTION_DROP;
14 
15 	return 0;
16 }
17 
18 struct mlx5e_tc_act mlx5e_tc_act_drop = {
19 	.parse_action = tc_act_parse_drop,
20 	.is_terminating_action = true,
21 };
22