1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3 
4 #ifndef	_DR_STE_V1_
5 #define	_DR_STE_V1_
6 
7 #include "dr_types.h"
8 #include "dr_ste.h"
9 
10 bool dr_ste_v1_is_miss_addr_set(u8 *hw_ste_p);
11 void dr_ste_v1_set_miss_addr(u8 *hw_ste_p, u64 miss_addr);
12 u64 dr_ste_v1_get_miss_addr(u8 *hw_ste_p);
13 void dr_ste_v1_set_byte_mask(u8 *hw_ste_p, u16 byte_mask);
14 u16 dr_ste_v1_get_byte_mask(u8 *hw_ste_p);
15 void dr_ste_v1_set_next_lu_type(u8 *hw_ste_p, u16 lu_type);
16 u16 dr_ste_v1_get_next_lu_type(u8 *hw_ste_p);
17 void dr_ste_v1_set_hit_addr(u8 *hw_ste_p, u64 icm_addr, u32 ht_size);
18 void dr_ste_v1_init(u8 *hw_ste_p, u16 lu_type, bool is_rx, u16 gvmi);
19 void dr_ste_v1_prepare_for_postsend(u8 *hw_ste_p, u32 ste_size);
20 void dr_ste_v1_set_actions_tx(struct mlx5dr_domain *dmn, u8 *action_type_set,
21 			      u32 actions_caps, u8 *last_ste,
22 			      struct mlx5dr_ste_actions_attr *attr, u32 *added_stes);
23 void dr_ste_v1_set_actions_rx(struct mlx5dr_domain *dmn, u8 *action_type_set,
24 			      u32 actions_caps, u8 *last_ste,
25 			      struct mlx5dr_ste_actions_attr *attr, u32 *added_stes);
26 void dr_ste_v1_set_action_set(u8 *d_action, u8 hw_field, u8 shifter,
27 			      u8 length, u32 data);
28 void dr_ste_v1_set_action_add(u8 *d_action, u8 hw_field, u8 shifter,
29 			      u8 length, u32 data);
30 void dr_ste_v1_set_action_copy(u8 *d_action, u8 dst_hw_field, u8 dst_shifter,
31 			       u8 dst_len, u8 src_hw_field, u8 src_shifter);
32 int dr_ste_v1_set_action_decap_l3_list(void *data, u32 data_sz, u8 *hw_action,
33 				       u32 hw_action_sz, u16 *used_hw_action_num);
34 int dr_ste_v1_alloc_modify_hdr_ptrn_arg(struct mlx5dr_action *action);
35 void dr_ste_v1_free_modify_hdr_ptrn_arg(struct mlx5dr_action *action);
36 void dr_ste_v1_build_eth_l2_src_dst_init(struct mlx5dr_ste_build *sb,
37 					 struct mlx5dr_match_param *mask);
38 void dr_ste_v1_build_eth_l3_ipv6_dst_init(struct mlx5dr_ste_build *sb,
39 					  struct mlx5dr_match_param *mask);
40 void dr_ste_v1_build_eth_l3_ipv6_src_init(struct mlx5dr_ste_build *sb,
41 					  struct mlx5dr_match_param *mask);
42 void dr_ste_v1_build_eth_l3_ipv4_5_tuple_init(struct mlx5dr_ste_build *sb,
43 					      struct mlx5dr_match_param *mask);
44 void dr_ste_v1_build_eth_l2_src_init(struct mlx5dr_ste_build *sb,
45 				     struct mlx5dr_match_param *mask);
46 void dr_ste_v1_build_eth_l2_dst_init(struct mlx5dr_ste_build *sb,
47 				     struct mlx5dr_match_param *mask);
48 void dr_ste_v1_build_eth_l2_tnl_init(struct mlx5dr_ste_build *sb,
49 				     struct mlx5dr_match_param *mask);
50 void dr_ste_v1_build_eth_l3_ipv4_misc_init(struct mlx5dr_ste_build *sb,
51 					   struct mlx5dr_match_param *mask);
52 void dr_ste_v1_build_eth_ipv6_l3_l4_init(struct mlx5dr_ste_build *sb,
53 					 struct mlx5dr_match_param *mask);
54 void dr_ste_v1_build_mpls_init(struct mlx5dr_ste_build *sb,
55 			       struct mlx5dr_match_param *mask);
56 void dr_ste_v1_build_tnl_gre_init(struct mlx5dr_ste_build *sb,
57 				  struct mlx5dr_match_param *mask);
58 void dr_ste_v1_build_tnl_mpls_init(struct mlx5dr_ste_build *sb,
59 				   struct mlx5dr_match_param *mask);
60 void dr_ste_v1_build_tnl_mpls_over_udp_init(struct mlx5dr_ste_build *sb,
61 					    struct mlx5dr_match_param *mask);
62 void dr_ste_v1_build_tnl_mpls_over_gre_init(struct mlx5dr_ste_build *sb,
63 					    struct mlx5dr_match_param *mask);
64 void dr_ste_v1_build_icmp_init(struct mlx5dr_ste_build *sb,
65 			       struct mlx5dr_match_param *mask);
66 void dr_ste_v1_build_general_purpose_init(struct mlx5dr_ste_build *sb,
67 					  struct mlx5dr_match_param *mask);
68 void dr_ste_v1_build_eth_l4_misc_init(struct mlx5dr_ste_build *sb,
69 				      struct mlx5dr_match_param *mask);
70 void dr_ste_v1_build_flex_parser_tnl_vxlan_gpe_init(struct mlx5dr_ste_build *sb,
71 						    struct mlx5dr_match_param *mask);
72 void dr_ste_v1_build_flex_parser_tnl_geneve_init(struct mlx5dr_ste_build *sb,
73 						 struct mlx5dr_match_param *mask);
74 void dr_ste_v1_build_tnl_header_0_1_init(struct mlx5dr_ste_build *sb,
75 					 struct mlx5dr_match_param *mask);
76 void dr_ste_v1_build_register_0_init(struct mlx5dr_ste_build *sb,
77 				     struct mlx5dr_match_param *mask);
78 void dr_ste_v1_build_register_1_init(struct mlx5dr_ste_build *sb,
79 				     struct mlx5dr_match_param *mask);
80 void dr_ste_v1_build_src_gvmi_qpn_init(struct mlx5dr_ste_build *sb,
81 				       struct mlx5dr_match_param *mask);
82 void dr_ste_v1_build_flex_parser_0_init(struct mlx5dr_ste_build *sb,
83 					struct mlx5dr_match_param *mask);
84 void dr_ste_v1_build_flex_parser_1_init(struct mlx5dr_ste_build *sb,
85 					struct mlx5dr_match_param *mask);
86 void dr_ste_v1_build_flex_parser_tnl_geneve_tlv_opt_init(struct mlx5dr_ste_build *sb,
87 							 struct mlx5dr_match_param *mask);
88 void dr_ste_v1_build_flex_parser_tnl_geneve_tlv_opt_exist_init(struct mlx5dr_ste_build *sb,
89 							       struct mlx5dr_match_param *mask);
90 void dr_ste_v1_build_flex_parser_tnl_gtpu_init(struct mlx5dr_ste_build *sb,
91 					       struct mlx5dr_match_param *mask);
92 void dr_ste_v1_build_tnl_gtpu_flex_parser_0_init(struct mlx5dr_ste_build *sb,
93 						 struct mlx5dr_match_param *mask);
94 void dr_ste_v1_build_tnl_gtpu_flex_parser_1_init(struct mlx5dr_ste_build *sb,
95 						 struct mlx5dr_match_param *mask);
96 
97 #endif  /* _DR_STE_V1_ */
98