Lines Matching +full:ports +full:- +full:block +full:- +full:group +full:- +full:count
1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */
33 #define MLXSW_SP_DEFAULT_VID (VLAN_N_VID - 1)
85 MLXSW_SP_RIF_TYPE_IPIP_LB, /* IP-in-IP loopback. */
158 struct mlxsw_sp_port **ports; member
224 * is responsible for freeing the passed-in SKB.
230 * is responsible for freeing the passed-in SKB.
296 /* No need an internal lock; At worse - miss a single periodic iteration */
400 unsigned int nbits = mlxsw_core_max_ports(mlxsw_sp->core); in mlxsw_sp_port_bitmap_init()
402 ports_bm->nbits = nbits; in mlxsw_sp_port_bitmap_init()
403 ports_bm->bitmap = bitmap_zalloc(nbits, GFP_KERNEL); in mlxsw_sp_port_bitmap_init()
404 if (!ports_bm->bitmap) in mlxsw_sp_port_bitmap_init()
405 return -ENOMEM; in mlxsw_sp_port_bitmap_init()
413 bitmap_free(ports_bm->bitmap); in mlxsw_sp_port_bitmap_fini()
472 return mlxsw_sp_port->link.tx_pause || mlxsw_sp_port->link.rx_pause; in mlxsw_sp_port_is_pause_en()
481 local_port = mlxsw_core_lag_mapping_get(mlxsw_sp->core, in mlxsw_sp_port_lagged_get()
483 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_port_lagged_get()
484 return mlxsw_sp_port && mlxsw_sp_port->lagged ? mlxsw_sp_port : NULL; in mlxsw_sp_port_lagged_get()
493 list_for_each_entry(mlxsw_sp_port_vlan, &mlxsw_sp_port->vlans_list, in mlxsw_sp_port_vlan_find_by_vid()
495 if (mlxsw_sp_port_vlan->vid == vid) in mlxsw_sp_port_vlan_find_by_vid()
523 unsigned int max_ports = mlxsw_core_max_ports(mlxsw_sp->core); in mlxsw_sp_local_port_is_valid()
911 mlxsw_sp_flow_block_mlxsw_sp(struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_mlxsw_sp() argument
913 return block->mlxsw_sp; in mlxsw_sp_flow_block_mlxsw_sp()
917 mlxsw_sp_flow_block_rule_count(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_rule_count() argument
919 return block ? block->rule_count : 0; in mlxsw_sp_flow_block_rule_count()
923 mlxsw_sp_flow_block_disable_inc(struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_disable_inc() argument
925 if (block) in mlxsw_sp_flow_block_disable_inc()
926 block->disable_count++; in mlxsw_sp_flow_block_disable_inc()
930 mlxsw_sp_flow_block_disable_dec(struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_disable_dec() argument
932 if (block) in mlxsw_sp_flow_block_disable_dec()
933 block->disable_count--; in mlxsw_sp_flow_block_disable_dec()
937 mlxsw_sp_flow_block_disabled(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_disabled() argument
939 return block->disable_count; in mlxsw_sp_flow_block_disabled()
943 mlxsw_sp_flow_block_is_egress_bound(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_is_egress_bound() argument
945 return block->egress_binding_count; in mlxsw_sp_flow_block_is_egress_bound()
949 mlxsw_sp_flow_block_is_ingress_bound(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_is_ingress_bound() argument
951 return block->ingress_binding_count; in mlxsw_sp_flow_block_is_ingress_bound()
955 mlxsw_sp_flow_block_is_mixed_bound(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_is_mixed_bound() argument
957 return block->ingress_binding_count && block->egress_binding_count; in mlxsw_sp_flow_block_is_mixed_bound()
962 void mlxsw_sp_flow_block_destroy(struct mlxsw_sp_flow_block *block);
979 struct mlxsw_sp_flow_block *block,
982 struct mlxsw_sp_flow_block *block,
986 struct mlxsw_sp_flow_block *block, u32 chain_index,
990 struct mlxsw_sp_flow_block *block, u32 chain_index,
1026 struct mlxsw_sp_flow_block *block,
1060 struct mlxsw_sp_flow_block *block,
1099 return mlxsw_afa_cookie_lookup(mlxsw_sp->afa, cookie_index); in mlxsw_sp_acl_act_cookie_lookup()
1206 int span_id; /* Relevant for Spectrum-2 onwards. */
1224 struct mlxsw_sp_flow_block *block,
1226 void mlxsw_sp_mall_destroy(struct mlxsw_sp_flow_block *block,
1228 int mlxsw_sp_mall_port_bind(struct mlxsw_sp_flow_block *block,
1231 void mlxsw_sp_mall_port_unbind(struct mlxsw_sp_flow_block *block,
1233 int mlxsw_sp_mall_prio_get(struct mlxsw_sp_flow_block *block, u32 chain_index,
1238 struct mlxsw_sp_flow_block *block,
1241 struct mlxsw_sp_flow_block *block,
1244 struct mlxsw_sp_flow_block *block,
1247 struct mlxsw_sp_flow_block *block,
1250 struct mlxsw_sp_flow_block *block,
1253 struct mlxsw_sp_flow_block *block,
1337 #define MLXSW_SP_MR_ROUTE_PRIO_MAX (__MLXSW_SP_MR_ROUTE_PRIO_MAX - 1)
1420 const struct devlink_trap_group *group);
1422 const struct devlink_trap_group *group,
1443 return mlxsw_core_net(mlxsw_sp->core); in mlxsw_sp_net()
1459 MLXSW_SP_POLICER_TYPE_MAX = __MLXSW_SP_POLICER_TYPE_MAX - 1,
1486 u16 count);
1488 u16 count);