Lines Matching defs:esw

15 #include "esw/indir_table.h"
67 mlx5_esw_indir_table_needed(struct mlx5_eswitch *esw,
75 vf_sf_vport = mlx5_eswitch_is_vf_vport(esw, vport_num) ||
76 mlx5_esw_is_sf_vport(esw, vport_num);
83 esw->dev == dest_mdev &&
95 static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw,
100 struct mlx5_fs_chains *chains = esw_chains(esw);
119 data = mlx5_eswitch_get_vport_metadata_for_set(esw, esw_attr->rx_tun_attr->decap_vport);
120 err = mlx5e_tc_match_to_reg_set(esw->dev, &mod_acts, MLX5_FLOW_NAMESPACE_FDB,
125 err = mlx5e_tc_match_to_reg_set(esw->dev, &mod_acts, MLX5_FLOW_NAMESPACE_FDB,
130 flow_act.modify_hdr = mlx5_modify_header_alloc(esw->dev, MLX5_FLOW_NAMESPACE_FDB,
162 mlx5_modify_header_dealloc(esw->dev, flow_act.modify_hdr);
171 static void mlx5_esw_indir_table_rule_put(struct mlx5_eswitch *esw,
175 struct mlx5_fs_chains *chains = esw_chains(esw);
185 mlx5_modify_header_dealloc(esw->dev, rule->mh);
209 static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
234 dest.vport.vhca_id = MLX5_CAP_GEN(esw->dev, vhca_id);
248 mlx5_esw_indir_table_entry_create(struct mlx5_eswitch *esw, struct mlx5_flow_attr *attr,
257 root_ns = mlx5_get_flow_namespace(esw->dev, MLX5_FLOW_NAMESPACE_FDB);
284 err = mlx5_esw_indir_table_rule_get(esw, attr, e);
289 err = mlx5_create_indir_fwd_group(esw, e);
293 hash_add(esw->fdb_table.offloads.indir->table, &e->hlist,
300 mlx5_esw_indir_table_rule_put(esw, e);
311 mlx5_esw_indir_table_entry_lookup(struct mlx5_eswitch *esw, u16 vport)
316 hash_for_each_possible(esw->fdb_table.offloads.indir->table, e, hlist, key)
323 struct mlx5_flow_table *mlx5_esw_indir_table_get(struct mlx5_eswitch *esw,
330 mutex_lock(&esw->fdb_table.offloads.indir->lock);
331 e = mlx5_esw_indir_table_entry_lookup(esw, vport);
336 err = mlx5_esw_indir_table_rule_get(esw, attr, e);
341 e = mlx5_esw_indir_table_entry_create(esw, attr, vport, decap);
344 esw_warn(esw->dev, "Failed to create indirection table, err %d.\n", err);
348 mutex_unlock(&esw->fdb_table.offloads.indir->lock);
352 mutex_unlock(&esw->fdb_table.offloads.indir->lock);
356 void mlx5_esw_indir_table_put(struct mlx5_eswitch *esw,
361 mutex_lock(&esw->fdb_table.offloads.indir->lock);
362 e = mlx5_esw_indir_table_entry_lookup(esw, vport);
369 mlx5_esw_indir_table_rule_put(esw, e);
381 mutex_unlock(&esw->fdb_table.offloads.indir->lock);