#include "dr_types.h"
#include "dr_ste.h"
enum dr_action_domain { … };
enum dr_action_valid_state { … };
static const char * const action_type_to_str[] = …;
static const char *dr_action_id_to_str(enum mlx5dr_action_type action_id)
{ … }
static bool mlx5dr_action_supp_fwd_fdb_multi_ft(struct mlx5_core_dev *dev)
{ … }
static const enum dr_action_valid_state
next_action_state[DR_ACTION_DOMAIN_MAX][DR_ACTION_STATE_MAX][DR_ACTION_TYP_MAX] = …;
static int
dr_action_reformat_to_action_type(enum mlx5dr_action_reformat_type reformat_type,
enum mlx5dr_action_type *action_type)
{ … }
static void dr_actions_apply(struct mlx5dr_domain *dmn,
enum mlx5dr_domain_nic_type nic_type,
u8 *action_type_set,
u8 *last_ste,
struct mlx5dr_ste_actions_attr *attr,
u32 *new_num_stes)
{ … }
static enum dr_action_domain
dr_action_get_action_domain(enum mlx5dr_domain_type domain,
enum mlx5dr_domain_nic_type nic_type)
{ … }
static
int dr_action_validate_and_get_next_state(enum dr_action_domain action_domain,
u32 action_type,
u32 *state)
{ … }
static int dr_action_handle_cs_recalc(struct mlx5dr_domain *dmn,
struct mlx5dr_action *dest_action,
u64 *final_icm_addr)
{ … }
static void dr_action_modify_ttl_adjust(struct mlx5dr_domain *dmn,
struct mlx5dr_ste_actions_attr *attr,
bool rx_rule,
bool *recalc_cs_required)
{ … }
static void dr_action_print_sequence(struct mlx5dr_domain *dmn,
struct mlx5dr_action *actions[],
int last_idx)
{ … }
static int dr_action_get_dest_fw_tbl_addr(struct mlx5dr_matcher *matcher,
struct mlx5dr_action_dest_tbl *dest_tbl,
bool is_rx_rule,
u64 *final_icm_addr)
{ … }
static int dr_action_get_dest_sw_tbl_addr(struct mlx5dr_matcher *matcher,
struct mlx5dr_action_dest_tbl *dest_tbl,
bool is_rx_rule,
u64 *final_icm_addr)
{ … }
static int dr_action_get_dest_tbl_addr(struct mlx5dr_matcher *matcher,
struct mlx5dr_action_dest_tbl *dest_tbl,
bool is_rx_rule,
u64 *final_icm_addr)
{ … }
#define WITH_VLAN_NUM_HW_ACTIONS …
int mlx5dr_actions_build_ste_arr(struct mlx5dr_matcher *matcher,
struct mlx5dr_matcher_rx_tx *nic_matcher,
struct mlx5dr_action *actions[],
u32 num_actions,
u8 *ste_arr,
u32 *new_hw_ste_arr_sz)
{ … }
static unsigned int action_size[DR_ACTION_TYP_MAX] = …;
static struct mlx5dr_action *
dr_action_create_generic(enum mlx5dr_action_type action_type)
{ … }
struct mlx5dr_action *mlx5dr_action_create_drop(void)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_dest_table_num(struct mlx5dr_domain *dmn, u32 table_num)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_dest_table(struct mlx5dr_table *tbl)
{ … }
static void dr_action_range_definer_fill(u16 *format_id,
u8 *dw_selectors,
u8 *byte_selectors,
u8 *match_mask)
{ … }
static int dr_action_create_range_definer(struct mlx5dr_action *action)
{ … }
static void dr_action_destroy_range_definer(struct mlx5dr_action *action)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_dest_match_range(struct mlx5dr_domain *dmn,
u32 field,
struct mlx5_flow_table *hit_ft,
struct mlx5_flow_table *miss_ft,
u32 min,
u32 max)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,
struct mlx5dr_action_dest *dests,
u32 num_of_dests,
bool ignore_flow_level,
u32 flow_source)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_dest_flow_fw_table(struct mlx5dr_domain *dmn,
struct mlx5_flow_table *ft)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_flow_counter(u32 counter_id)
{ … }
struct mlx5dr_action *mlx5dr_action_create_tag(u32 tag_value)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_flow_sampler(struct mlx5dr_domain *dmn, u32 sampler_id)
{ … }
static int
dr_action_verify_reformat_params(enum mlx5dr_action_type reformat_type,
struct mlx5dr_domain *dmn,
u8 reformat_param_0,
u8 reformat_param_1,
size_t data_sz,
void *data)
{ … }
static int
dr_action_create_reformat_action(struct mlx5dr_domain *dmn,
u8 reformat_param_0, u8 reformat_param_1,
size_t data_sz, void *data,
struct mlx5dr_action *action)
{ … }
#define CVLAN_ETHERTYPE …
#define SVLAN_ETHERTYPE …
struct mlx5dr_action *mlx5dr_action_create_pop_vlan(void)
{ … }
struct mlx5dr_action *mlx5dr_action_create_push_vlan(struct mlx5dr_domain *dmn,
__be32 vlan_hdr)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_packet_reformat(struct mlx5dr_domain *dmn,
enum mlx5dr_action_reformat_type reformat_type,
u8 reformat_param_0,
u8 reformat_param_1,
size_t data_sz,
void *data)
{ … }
static int
dr_action_modify_sw_to_hw_add(struct mlx5dr_domain *dmn,
__be64 *sw_action,
__be64 *hw_action,
const struct mlx5dr_ste_action_modify_field **ret_hw_info)
{ … }
static int
dr_action_modify_sw_to_hw_set(struct mlx5dr_domain *dmn,
__be64 *sw_action,
__be64 *hw_action,
const struct mlx5dr_ste_action_modify_field **ret_hw_info)
{ … }
static int
dr_action_modify_sw_to_hw_copy(struct mlx5dr_domain *dmn,
__be64 *sw_action,
__be64 *hw_action,
const struct mlx5dr_ste_action_modify_field **ret_dst_hw_info,
const struct mlx5dr_ste_action_modify_field **ret_src_hw_info)
{ … }
static int
dr_action_modify_sw_to_hw(struct mlx5dr_domain *dmn,
__be64 *sw_action,
__be64 *hw_action,
const struct mlx5dr_ste_action_modify_field **ret_dst_hw_info,
const struct mlx5dr_ste_action_modify_field **ret_src_hw_info)
{ … }
static int
dr_action_modify_check_set_field_limitation(struct mlx5dr_action *action,
const __be64 *sw_action)
{ … }
static int
dr_action_modify_check_add_field_limitation(struct mlx5dr_action *action,
const __be64 *sw_action)
{ … }
static int
dr_action_modify_check_copy_field_limitation(struct mlx5dr_action *action,
const __be64 *sw_action)
{ … }
static int
dr_action_modify_check_field_limitation(struct mlx5dr_action *action,
const __be64 *sw_action)
{ … }
static bool
dr_action_modify_check_is_ttl_modify(const void *sw_action)
{ … }
static int dr_actions_convert_modify_header(struct mlx5dr_action *action,
u32 max_hw_actions,
u32 num_sw_actions,
__be64 sw_actions[],
__be64 hw_actions[],
u32 *num_hw_actions,
bool *modify_ttl)
{ … }
static int dr_action_create_modify_action(struct mlx5dr_domain *dmn,
size_t actions_sz,
__be64 actions[],
struct mlx5dr_action *action)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_modify_header(struct mlx5dr_domain *dmn,
u32 flags,
size_t actions_sz,
__be64 actions[])
{ … }
struct mlx5dr_action *
mlx5dr_action_create_dest_vport(struct mlx5dr_domain *dmn,
u16 vport, u8 vhca_id_valid,
u16 vhca_id)
{ … }
struct mlx5dr_action *
mlx5dr_action_create_aso(struct mlx5dr_domain *dmn, u32 obj_id,
u8 dest_reg_id, u8 aso_type,
u8 init_color, u8 meter_id)
{ … }
u32 mlx5dr_action_get_pkt_reformat_id(struct mlx5dr_action *action)
{ … }
int mlx5dr_action_destroy(struct mlx5dr_action *action)
{ … }