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_accept(struct mlx5e_tc_act_parse_state *parse_state,
9 			  const struct flow_action_entry *act,
10 			  int act_index,
11 			  struct mlx5_flow_attr *attr)
12 {
13 	return true;
14 }
15 
16 static int
17 tc_act_parse_accept(struct mlx5e_tc_act_parse_state *parse_state,
18 		    const struct flow_action_entry *act,
19 		    struct mlx5e_priv *priv,
20 		    struct mlx5_flow_attr *attr)
21 {
22 	attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
23 	attr->flags |= MLX5_ATTR_FLAG_ACCEPT;
24 
25 	return 0;
26 }
27 
28 struct mlx5e_tc_act mlx5e_tc_act_accept = {
29 	.can_offload = tc_act_can_offload_accept,
30 	.parse_action = tc_act_parse_accept,
31 	.is_terminating_action = true,
32 };
33