/Linux-v4.19/drivers/net/ethernet/mellanox/mlxsw/ |
D | spectrum.h | 120 struct mlxsw_sp { struct 152 mlxsw_sp_lag_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id) in mlxsw_sp_lag_get() argument 154 return &mlxsw_sp->lags[lag_id]; in mlxsw_sp_lag_get() 199 struct mlxsw_sp *mlxsw_sp; member 245 mlxsw_sp_port_lagged_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id, u8 port_index) in mlxsw_sp_port_lagged_get() argument 250 local_port = mlxsw_core_lag_mapping_get(mlxsw_sp->core, in mlxsw_sp_port_lagged_get() 252 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_port_lagged_get() 278 int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp); 279 void mlxsw_sp_buffers_fini(struct mlxsw_sp *mlxsw_sp); 312 u32 mlxsw_sp_cells_bytes(const struct mlxsw_sp *mlxsw_sp, u32 cells); [all …]
|
D | spectrum_router.c | 49 struct mlxsw_sp *mlxsw_sp; member 87 struct mlxsw_sp *mlxsw_sp; member 140 static void mlxsw_sp_lpm_tree_put(struct mlxsw_sp *mlxsw_sp, 142 static int mlxsw_sp_vr_lpm_tree_bind(struct mlxsw_sp *mlxsw_sp, 145 static int mlxsw_sp_vr_lpm_tree_unbind(struct mlxsw_sp *mlxsw_sp, 189 static int mlxsw_sp_rif_counter_edit(struct mlxsw_sp *mlxsw_sp, u16 rif_index, in mlxsw_sp_rif_counter_edit() argument 200 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); in mlxsw_sp_rif_counter_edit() 206 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); in mlxsw_sp_rif_counter_edit() 209 int mlxsw_sp_rif_counter_value_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_rif_counter_value_get() argument 227 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ricnt), ricnt_pl); in mlxsw_sp_rif_counter_value_get() [all …]
|
D | spectrum_acl_tcam.h | 24 size_t mlxsw_sp_acl_tcam_priv_size(struct mlxsw_sp *mlxsw_sp); 25 int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, 27 void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, 29 int mlxsw_sp_acl_tcam_priority_get(struct mlxsw_sp *mlxsw_sp, 35 int (*ruleset_add)(struct mlxsw_sp *mlxsw_sp, 38 void (*ruleset_del)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv); 39 int (*ruleset_bind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, 42 void (*ruleset_unbind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, 46 size_t (*rule_priv_size)(struct mlxsw_sp *mlxsw_sp); 47 int (*rule_add)(struct mlxsw_sp *mlxsw_sp, [all …]
|
D | spectrum_buffers.c | 52 u32 mlxsw_sp_cells_bytes(const struct mlxsw_sp *mlxsw_sp, u32 cells) in mlxsw_sp_cells_bytes() argument 54 return mlxsw_sp->sb->cell_size * cells; in mlxsw_sp_cells_bytes() 57 u32 mlxsw_sp_bytes_cells(const struct mlxsw_sp *mlxsw_sp, u32 bytes) in mlxsw_sp_bytes_cells() argument 59 return DIV_ROUND_UP(bytes, mlxsw_sp->sb->cell_size); in mlxsw_sp_bytes_cells() 62 static struct mlxsw_sp_sb_pr *mlxsw_sp_sb_pr_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_sb_pr_get() argument 66 return &mlxsw_sp->sb->prs[dir][pool]; in mlxsw_sp_sb_pr_get() 69 static struct mlxsw_sp_sb_cm *mlxsw_sp_sb_cm_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_sb_cm_get() argument 73 return &mlxsw_sp->sb->ports[local_port].cms[dir][pg_buff]; in mlxsw_sp_sb_cm_get() 76 static struct mlxsw_sp_sb_pm *mlxsw_sp_sb_pm_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_sb_pm_get() argument 80 return &mlxsw_sp->sb->ports[local_port].pms[dir][pool]; in mlxsw_sp_sb_pm_get() [all …]
|
D | spectrum_acl_flex_actions.c | 11 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_act_kvdl_set_add() local 22 err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, in mlxsw_sp_act_kvdl_set_add() 27 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pefa), pefa_pl); in mlxsw_sp_act_kvdl_set_add() 34 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, in mlxsw_sp_act_kvdl_set_add() 56 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_act_kvdl_set_del() local 60 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, in mlxsw_sp_act_kvdl_set_del() 73 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp2_act_kvdl_set_activity_get() local 78 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pefa), pefa_pl); in mlxsw_sp2_act_kvdl_set_activity_get() 88 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_act_kvdl_fwd_entry_add() local 93 err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_PBS, in mlxsw_sp_act_kvdl_fwd_entry_add() [all …]
|
D | spectrum_acl_tcam.c | 19 size_t mlxsw_sp_acl_tcam_priv_size(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_tcam_priv_size() argument 21 const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; in mlxsw_sp_acl_tcam_priv_size() 26 int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_tcam_init() argument 29 const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; in mlxsw_sp_acl_tcam_init() 36 max_tcam_regions = MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_acl_tcam_init() 38 max_regions = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_REGIONS); in mlxsw_sp_acl_tcam_init() 50 max_groups = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_GROUPS); in mlxsw_sp_acl_tcam_init() 58 tcam->max_group_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_acl_tcam_init() 61 err = ops->init(mlxsw_sp, tcam->priv, tcam); in mlxsw_sp_acl_tcam_init() 74 void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_tcam_fini() argument [all …]
|
D | spectrum_acl.c | 23 struct mlxsw_sp *mlxsw_sp; member 51 struct mlxsw_sp *mlxsw_sp; member 98 struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_acl_dummy_fid() argument 100 return mlxsw_sp->acl->dummy_fid; in mlxsw_sp_acl_dummy_fid() 103 struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block) in mlxsw_sp_acl_block_mlxsw_sp() 105 return block->mlxsw_sp; in mlxsw_sp_acl_block_mlxsw_sp() 149 mlxsw_sp_acl_ruleset_bind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_bind() argument 156 return ops->ruleset_bind(mlxsw_sp, ruleset->priv, in mlxsw_sp_acl_ruleset_bind() 161 mlxsw_sp_acl_ruleset_unbind(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ruleset_unbind() argument 168 ops->ruleset_unbind(mlxsw_sp, ruleset->priv, in mlxsw_sp_acl_ruleset_unbind() [all …]
|
D | spectrum_mr_tcam.c | 33 mlxsw_sp_mr_erif_sublist_full(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_mr_erif_sublist_full() argument 36 int erif_list_entries = MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_mr_erif_sublist_full() 49 mlxsw_sp_mr_erif_sublist_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_mr_erif_sublist_create() argument 58 err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_MCRIGR, in mlxsw_sp_mr_erif_sublist_create() 70 mlxsw_sp_mr_erif_sublist_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_mr_erif_sublist_destroy() argument 74 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_MCRIGR, in mlxsw_sp_mr_erif_sublist_destroy() 80 mlxsw_sp_mr_erif_list_add(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_mr_erif_list_add() argument 90 sublist = mlxsw_sp_mr_erif_sublist_create(mlxsw_sp, erif_list); in mlxsw_sp_mr_erif_list_add() 99 if (mlxsw_sp_mr_erif_sublist_full(mlxsw_sp, sublist)) { in mlxsw_sp_mr_erif_list_add() 100 sublist = mlxsw_sp_mr_erif_sublist_create(mlxsw_sp, in mlxsw_sp_mr_erif_list_add() [all …]
|
D | spectrum_mr.h | 44 int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv); 45 int (*route_create)(struct mlxsw_sp *mlxsw_sp, void *priv, 48 int (*route_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, 50 int (*route_stats)(struct mlxsw_sp *mlxsw_sp, void *route_priv, 52 int (*route_action_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, 54 int (*route_min_mtu_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, 56 int (*route_irif_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, 58 int (*route_erif_add)(struct mlxsw_sp *mlxsw_sp, void *route_priv, 60 int (*route_erif_del)(struct mlxsw_sp *mlxsw_sp, void *route_priv, 62 void (*route_destroy)(struct mlxsw_sp *mlxsw_sp, void *priv, [all …]
|
D | spectrum_fid.c | 72 struct mlxsw_sp *mlxsw_sp; member 137 err = mlxsw_reg_write(fid_family->mlxsw_sp->core, MLXSW_REG(sftr), in mlxsw_sp_fid_flood_set() 178 mlxsw_sp_fid_type_rif_type(const struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_fid_type_rif_type() argument 181 struct mlxsw_sp_fid_core *fid_core = mlxsw_sp->fid_core; in mlxsw_sp_fid_type_rif_type() 210 static int mlxsw_sp_fid_op(struct mlxsw_sp *mlxsw_sp, u16 fid_index, in mlxsw_sp_fid_op() argument 217 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfmr), sfmr_pl); in mlxsw_sp_fid_op() 220 static int mlxsw_sp_fid_vid_map(struct mlxsw_sp *mlxsw_sp, u16 fid_index, in mlxsw_sp_fid_vid_map() argument 227 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(svfa), svfa_pl); in mlxsw_sp_fid_vid_map() 230 static int __mlxsw_sp_fid_port_vid_map(struct mlxsw_sp *mlxsw_sp, u16 fid_index, in __mlxsw_sp_fid_port_vid_map() argument 237 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(svfa), svfa_pl); in __mlxsw_sp_fid_port_vid_map() [all …]
|
D | spectrum_kvdl.c | 15 int mlxsw_sp_kvdl_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_kvdl_init() argument 17 const struct mlxsw_sp_kvdl_ops *kvdl_ops = mlxsw_sp->kvdl_ops; in mlxsw_sp_kvdl_init() 21 kvdl = kzalloc(sizeof(*mlxsw_sp->kvdl) + kvdl_ops->priv_size, in mlxsw_sp_kvdl_init() 26 mlxsw_sp->kvdl = kvdl; in mlxsw_sp_kvdl_init() 28 err = kvdl_ops->init(mlxsw_sp, kvdl->priv); in mlxsw_sp_kvdl_init() 38 void mlxsw_sp_kvdl_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_kvdl_fini() argument 40 struct mlxsw_sp_kvdl *kvdl = mlxsw_sp->kvdl; in mlxsw_sp_kvdl_fini() 42 kvdl->kvdl_ops->fini(mlxsw_sp, kvdl->priv); in mlxsw_sp_kvdl_fini() 46 int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_kvdl_alloc() argument 50 struct mlxsw_sp_kvdl *kvdl = mlxsw_sp->kvdl; in mlxsw_sp_kvdl_alloc() [all …]
|
D | spectrum.c | 137 struct mlxsw_sp *mlxsw_sp; member 146 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_component_query() local 151 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcqi), mcqi_pl); in mlxsw_sp_component_query() 167 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_lock() local 173 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_lock() 184 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_lock() 193 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_component_update() local 198 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_component_update() 207 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_block_download() local 211 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcda), mcda_pl); in mlxsw_sp_fsm_block_download() [all …]
|
D | spectrum_router.h | 38 struct mlxsw_sp_rif *mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, 40 struct mlxsw_sp_rif *mlxsw_sp_rif_by_index(const struct mlxsw_sp *mlxsw_sp, 47 u8 mlxsw_sp_router_port(const struct mlxsw_sp *mlxsw_sp); 50 int mlxsw_sp_rif_counter_value_get(struct mlxsw_sp *mlxsw_sp, 54 void mlxsw_sp_rif_counter_free(struct mlxsw_sp *mlxsw_sp, 57 int mlxsw_sp_rif_counter_alloc(struct mlxsw_sp *mlxsw_sp, 73 int mlxsw_sp_neigh_counter_get(struct mlxsw_sp *mlxsw_sp, 77 mlxsw_sp_neigh_entry_counter_update(struct mlxsw_sp *mlxsw_sp, 81 int __mlxsw_sp_ipip_entry_update_tunnel(struct mlxsw_sp *mlxsw_sp, 87 void mlxsw_sp_ipip_entry_demote_tunnel(struct mlxsw_sp *mlxsw_sp, [all …]
|
D | spectrum_dpipe.c | 153 static int mlxsw_sp_erif_entry_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_erif_entry_get() argument 180 err = mlxsw_sp_rif_counter_value_get(mlxsw_sp, rif, in mlxsw_sp_erif_entry_get() 198 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_erif_entries_dump() local 212 rif_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); in mlxsw_sp_dpipe_table_erif_entries_dump() 221 struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); in mlxsw_sp_dpipe_table_erif_entries_dump() 225 err = mlxsw_sp_erif_entry_get(mlxsw_sp, &entry, rif, in mlxsw_sp_dpipe_table_erif_entries_dump() 257 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_erif_counters_update() local 261 for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { in mlxsw_sp_dpipe_table_erif_counters_update() 262 struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); in mlxsw_sp_dpipe_table_erif_counters_update() 267 mlxsw_sp_rif_counter_alloc(mlxsw_sp, rif, in mlxsw_sp_dpipe_table_erif_counters_update() [all …]
|
D | spectrum1_acl_tcam.c | 50 static int mlxsw_sp1_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv, in mlxsw_sp1_acl_tcam_init() argument 56 static void mlxsw_sp1_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv) in mlxsw_sp1_acl_tcam_fini() argument 61 mlxsw_sp1_acl_ctcam_region_catchall_add(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp1_acl_ctcam_region_catchall_add() argument 70 rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl); in mlxsw_sp1_acl_ctcam_region_catchall_add() 81 err = mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, ®ion->cregion, in mlxsw_sp1_acl_ctcam_region_catchall_add() 100 mlxsw_sp1_acl_ctcam_region_catchall_del(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp1_acl_ctcam_region_catchall_del() argument 105 mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, ®ion->cregion, in mlxsw_sp1_acl_ctcam_region_catchall_del() 113 mlxsw_sp1_acl_tcam_region_init(struct mlxsw_sp *mlxsw_sp, void *region_priv, in mlxsw_sp1_acl_tcam_region_init() argument 120 err = mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, ®ion->cregion, in mlxsw_sp1_acl_tcam_region_init() 125 err = mlxsw_sp1_acl_ctcam_region_catchall_add(mlxsw_sp, region); in mlxsw_sp1_acl_tcam_region_init() [all …]
|
D | spectrum_switchdev.c | 29 struct mlxsw_sp *mlxsw_sp; member 93 mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp, 124 bool mlxsw_sp_bridge_device_is_offloaded(const struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_bridge_device_is_offloaded() argument 127 return !!mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); in mlxsw_sp_bridge_device_is_offloaded() 133 struct mlxsw_sp *mlxsw_sp = data; in mlxsw_sp_bridge_device_upper_rif_destroy() local 135 mlxsw_sp_rif_destroy_by_dev(mlxsw_sp, dev); in mlxsw_sp_bridge_device_upper_rif_destroy() 139 static void mlxsw_sp_bridge_device_rifs_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_bridge_device_rifs_destroy() argument 142 mlxsw_sp_rif_destroy_by_dev(mlxsw_sp, dev); in mlxsw_sp_bridge_device_rifs_destroy() 145 mlxsw_sp); in mlxsw_sp_bridge_device_rifs_destroy() 152 struct device *dev = bridge->mlxsw_sp->bus_info->dev; in mlxsw_sp_bridge_device_create() [all …]
|
D | spectrum_span.c | 17 int mlxsw_sp_span_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_span_init() argument 21 if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_SPAN)) in mlxsw_sp_span_init() 24 mlxsw_sp->span.entries_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_span_init() 26 mlxsw_sp->span.entries = kcalloc(mlxsw_sp->span.entries_count, in mlxsw_sp_span_init() 29 if (!mlxsw_sp->span.entries) in mlxsw_sp_span_init() 32 for (i = 0; i < mlxsw_sp->span.entries_count; i++) { in mlxsw_sp_span_init() 33 struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; in mlxsw_sp_span_init() 42 void mlxsw_sp_span_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_span_fini() argument 46 for (i = 0; i < mlxsw_sp->span.entries_count; i++) { in mlxsw_sp_span_fini() 47 struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; in mlxsw_sp_span_fini() [all …]
|
D | spectrum_acl_ctcam.c | 14 mlxsw_sp_acl_ctcam_region_resize(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ctcam_region_resize() argument 23 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptar), ptar_pl); in mlxsw_sp_acl_ctcam_region_resize() 27 mlxsw_sp_acl_ctcam_region_move(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ctcam_region_move() argument 36 mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(prcr), prcr_pl); in mlxsw_sp_acl_ctcam_region_move() 40 mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ctcam_region_entry_insert() argument 47 struct mlxsw_afk *afk = mlxsw_sp_acl_afk(mlxsw_sp->acl); in mlxsw_sp_acl_ctcam_region_entry_insert() 56 err = mlxsw_sp_acl_tcam_priority_get(mlxsw_sp, rulei, &priority, in mlxsw_sp_acl_ctcam_region_entry_insert() 78 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); in mlxsw_sp_acl_ctcam_region_entry_insert() 82 mlxsw_sp_acl_ctcam_region_entry_remove(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_ctcam_region_entry_remove() argument 91 mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); in mlxsw_sp_acl_ctcam_region_entry_remove() [all …]
|
D | spectrum1_mr_tcam.c | 13 struct mlxsw_sp *mlxsw_sp; member 28 static int mlxsw_sp1_mr_tcam_route_replace(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp1_mr_tcam_route_replace() argument 57 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rmft2), rmft2_pl); in mlxsw_sp1_mr_tcam_route_replace() 60 static int mlxsw_sp1_mr_tcam_route_remove(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp1_mr_tcam_route_remove() argument 79 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rmft2), rmft2_pl); in mlxsw_sp1_mr_tcam_route_remove() 122 mlxsw_sp1_mr_tcam_route_create(struct mlxsw_sp *mlxsw_sp, void *priv, in mlxsw_sp1_mr_tcam_route_create() argument 137 err = mlxsw_sp1_mr_tcam_route_replace(mlxsw_sp, &route->parman_item, in mlxsw_sp1_mr_tcam_route_create() 149 mlxsw_sp1_mr_tcam_route_destroy(struct mlxsw_sp *mlxsw_sp, void *priv, in mlxsw_sp1_mr_tcam_route_destroy() argument 156 mlxsw_sp1_mr_tcam_route_remove(mlxsw_sp, &route->parman_item, key); in mlxsw_sp1_mr_tcam_route_destroy() 161 mlxsw_sp1_mr_tcam_route_update(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp1_mr_tcam_route_update() argument [all …]
|
D | spectrum_cnt.c | 33 static int mlxsw_sp_counter_pool_validate(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_counter_pool_validate() argument 39 pool_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, COUNTER_POOL_SIZE); in mlxsw_sp_counter_pool_validate() 48 static int mlxsw_sp_counter_sub_pools_prepare(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_counter_sub_pools_prepare() argument 54 if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, COUNTER_SIZE_PACKETS_BYTES)) in mlxsw_sp_counter_sub_pools_prepare() 56 sub_pool->entry_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_counter_sub_pools_prepare() 60 if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, COUNTER_SIZE_ROUTER_BASIC)) in mlxsw_sp_counter_sub_pools_prepare() 62 sub_pool->entry_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_counter_sub_pools_prepare() 67 int mlxsw_sp_counter_pool_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_counter_pool_init() argument 76 if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, COUNTER_POOL_SIZE)) in mlxsw_sp_counter_pool_init() 79 err = mlxsw_sp_counter_pool_validate(mlxsw_sp); in mlxsw_sp_counter_pool_init() [all …]
|
D | spectrum_flower.c | 17 static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_parse_actions() argument 30 err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack); in mlxsw_sp_flower_parse_actions() 58 ruleset = mlxsw_sp_acl_ruleset_lookup(mlxsw_sp, block, in mlxsw_sp_flower_parse_actions() 75 fid = mlxsw_sp_acl_dummy_fid(mlxsw_sp); in mlxsw_sp_flower_parse_actions() 77 err = mlxsw_sp_acl_rulei_act_fid_set(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions() 83 err = mlxsw_sp_acl_rulei_act_fwd(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions() 90 err = mlxsw_sp_acl_rulei_act_mirror(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions() 101 return mlxsw_sp_acl_rulei_act_vlan(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions() 106 dev_err(mlxsw_sp->bus_info->dev, "Unsupported action\n"); in mlxsw_sp_flower_parse_actions() 171 static int mlxsw_sp_flower_parse_ports(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_parse_ports() argument [all …]
|
D | spectrum2_acl_tcam.c | 69 static int mlxsw_sp2_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv, in mlxsw_sp2_acl_tcam_init() argument 81 err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, in mlxsw_sp2_acl_tcam_init() 90 afa_block = mlxsw_afa_block_create(mlxsw_sp->afa); in mlxsw_sp2_acl_tcam_init() 103 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pefa), pefa_pl); in mlxsw_sp2_acl_tcam_init() 108 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pgcr), pgcr_pl); in mlxsw_sp2_acl_tcam_init() 112 err = mlxsw_sp_acl_atcam_init(mlxsw_sp, &tcam->atcam); in mlxsw_sp2_acl_tcam_init() 125 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, in mlxsw_sp2_acl_tcam_init() 130 static void mlxsw_sp2_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv) in mlxsw_sp2_acl_tcam_fini() argument 134 mlxsw_sp_acl_atcam_fini(mlxsw_sp, &tcam->atcam); in mlxsw_sp2_acl_tcam_fini() 135 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, in mlxsw_sp2_acl_tcam_fini() [all …]
|
D | spectrum_acl_atcam.c | 119 struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; in mlxsw_sp_acl_atcam_region_12kb_init() local 125 if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_MAX_LARGE_KEY_ID)) in mlxsw_sp_acl_atcam_region_12kb_init() 128 max_lkey_id = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_LARGE_KEY_ID); in mlxsw_sp_acl_atcam_region_12kb_init() 229 struct mlxsw_sp *mlxsw_sp = region->mlxsw_sp; in mlxsw_sp_acl_atcam_12kb_lkey_id_get() local 230 struct mlxsw_afk *afk = mlxsw_sp_acl_afk(mlxsw_sp->acl); in mlxsw_sp_acl_atcam_12kb_lkey_id_get() 275 int mlxsw_sp_acl_atcam_region_associate(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_atcam_region_associate() argument 283 max_regions = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_REGIONS); in mlxsw_sp_acl_atcam_region_associate() 288 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(perar), perar_pl); in mlxsw_sp_acl_atcam_region_associate() 316 mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_acl_atcam_region_init() argument 338 err = mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_region_init() [all …]
|
D | spectrum2_kvdl.c | 105 static int mlxsw_sp2_kvdl_rec_del(struct mlxsw_sp *mlxsw_sp, u8 res_type, in mlxsw_sp2_kvdl_rec_del() argument 117 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(iedr), iedr_pl); in mlxsw_sp2_kvdl_rec_del() 122 static void mlxsw_sp2_kvdl_part_free(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp2_kvdl_part_free() argument 132 err = mlxsw_sp2_kvdl_rec_del(mlxsw_sp, part->info->res_type, in mlxsw_sp2_kvdl_part_free() 143 static int mlxsw_sp2_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, void *priv, in mlxsw_sp2_kvdl_alloc() argument 155 static void mlxsw_sp2_kvdl_free(struct mlxsw_sp *mlxsw_sp, void *priv, in mlxsw_sp2_kvdl_free() argument 164 return mlxsw_sp2_kvdl_part_free(mlxsw_sp, part, size, entry_index); in mlxsw_sp2_kvdl_free() 167 static int mlxsw_sp2_kvdl_alloc_size_query(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp2_kvdl_alloc_size_query() argument 178 mlxsw_sp2_kvdl_part_init(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp2_kvdl_part_init() argument 187 if (!mlxsw_core_res_valid(mlxsw_sp->core, in mlxsw_sp2_kvdl_part_init() [all …]
|
D | spectrum_mr.c | 65 struct mlxsw_sp *mlxsw_sp; member 249 struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; in mlxsw_sp_mr_route_write() local 251 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_write() 271 err = mr->mr_ops->route_create(mlxsw_sp, mr->priv, in mlxsw_sp_mr_route_write() 277 err = mr->mr_ops->route_update(mlxsw_sp, mr_route->route_priv, in mlxsw_sp_mr_route_write() 288 struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; in mlxsw_sp_mr_route_erase() local 289 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_erase() 291 mr->mr_ops->route_destroy(mlxsw_sp, mr->priv, mr_route->route_priv); in mlxsw_sp_mr_route_erase() 412 dev_warn(mr_table->mlxsw_sp->bus_info->dev, in mlxsw_sp_mr_route_add() 472 struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; in mlxsw_sp_mr_route_ivif_resolve() local [all …]
|