Lines Matching refs:mlxsw_sp
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()
219 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_component_verify() local
224 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_component_verify()
231 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_activate() local
236 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_activate()
245 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_query_state() local
252 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_query_state()
267 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_cancel() local
272 mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_cancel()
279 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; in mlxsw_sp_fsm_release() local
285 mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); in mlxsw_sp_fsm_release()
300 static int mlxsw_sp_firmware_flash(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_firmware_flash() argument
306 .psid = mlxsw_sp->bus_info->psid, in mlxsw_sp_firmware_flash()
307 .psid_size = strlen(mlxsw_sp->bus_info->psid), in mlxsw_sp_firmware_flash()
309 .mlxsw_sp = mlxsw_sp in mlxsw_sp_firmware_flash()
315 static int mlxsw_sp_fw_rev_validate(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_fw_rev_validate() argument
317 const struct mlxsw_fw_rev *rev = &mlxsw_sp->bus_info->fw_rev; in mlxsw_sp_fw_rev_validate()
318 const struct mlxsw_fw_rev *req_rev = mlxsw_sp->req_rev; in mlxsw_sp_fw_rev_validate()
319 const char *fw_filename = mlxsw_sp->fw_filename; in mlxsw_sp_fw_rev_validate()
337 …dev_info(mlxsw_sp->bus_info->dev, "The firmware version %d.%d.%d is incompatible with the driver\n… in mlxsw_sp_fw_rev_validate()
339 dev_info(mlxsw_sp->bus_info->dev, "Flashing firmware using file %s\n", in mlxsw_sp_fw_rev_validate()
343 mlxsw_sp->bus_info->dev); in mlxsw_sp_fw_rev_validate()
345 dev_err(mlxsw_sp->bus_info->dev, "Could not request firmware file %s\n", in mlxsw_sp_fw_rev_validate()
350 err = mlxsw_sp_firmware_flash(mlxsw_sp, firmware); in mlxsw_sp_fw_rev_validate()
353 dev_err(mlxsw_sp->bus_info->dev, "Could not upgrade firmware\n"); in mlxsw_sp_fw_rev_validate()
364 int mlxsw_sp_flow_counter_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flow_counter_get() argument
373 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mgpc), mgpc_pl); in mlxsw_sp_flow_counter_get()
383 static int mlxsw_sp_flow_counter_clear(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flow_counter_clear() argument
390 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mgpc), mgpc_pl); in mlxsw_sp_flow_counter_clear()
393 int mlxsw_sp_flow_counter_alloc(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flow_counter_alloc() argument
398 err = mlxsw_sp_counter_alloc(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_FLOW, in mlxsw_sp_flow_counter_alloc()
402 err = mlxsw_sp_flow_counter_clear(mlxsw_sp, *p_counter_index); in mlxsw_sp_flow_counter_alloc()
408 mlxsw_sp_counter_free(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_FLOW, in mlxsw_sp_flow_counter_alloc()
413 void mlxsw_sp_flow_counter_free(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flow_counter_free() argument
416 mlxsw_sp_counter_free(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_FLOW, in mlxsw_sp_flow_counter_free()
456 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_vid_stp_set() local
466 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spms), spms_pl); in mlxsw_sp_port_vid_stp_set()
471 static int mlxsw_sp_base_mac_get(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_base_mac_get() argument
476 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(spad), spad_pl); in mlxsw_sp_base_mac_get()
479 mlxsw_reg_spad_base_mac_memcpy_from(spad_pl, mlxsw_sp->base_mac); in mlxsw_sp_base_mac_get()
486 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_sample_set() local
490 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpsc), mpsc_pl); in mlxsw_sp_port_sample_set()
496 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_admin_status_set() local
502 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(paos), paos_pl); in mlxsw_sp_port_admin_status_set()
508 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_dev_addr_set() local
513 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ppad), ppad_pl); in mlxsw_sp_port_dev_addr_set()
518 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_dev_addr_init() local
521 ether_addr_copy(addr, mlxsw_sp->base_mac); in mlxsw_sp_port_dev_addr_init()
528 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_mtu_set() local
535 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pmtu), pmtu_pl); in mlxsw_sp_port_mtu_set()
544 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pmtu), pmtu_pl); in mlxsw_sp_port_mtu_set()
549 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_swid_set() local
553 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pspa), pspa_pl); in mlxsw_sp_port_swid_set()
558 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_vp_mode_set() local
562 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(svpe), svpe_pl); in mlxsw_sp_port_vp_mode_set()
568 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_vid_learning_set() local
577 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spvmlr), spvmlr_pl); in mlxsw_sp_port_vid_learning_set()
585 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in __mlxsw_sp_port_pvid_set() local
589 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spvid), spvid_pl); in __mlxsw_sp_port_pvid_set()
595 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_allow_untagged_set() local
599 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spaft), spaft_pl); in mlxsw_sp_port_allow_untagged_set()
630 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_system_port_mapping_set() local
634 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sspr), sspr_pl); in mlxsw_sp_port_system_port_mapping_set()
637 static int mlxsw_sp_port_module_info_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_port_module_info_get() argument
645 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pmlp), pmlp_pl); in mlxsw_sp_port_module_info_get()
657 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_module_map() local
668 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pmlp), pmlp_pl); in mlxsw_sp_port_module_map()
673 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_module_unmap() local
678 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pmlp), pmlp_pl); in mlxsw_sp_port_module_unmap()
705 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_xmit() local
714 if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info)) in mlxsw_sp_port_xmit()
743 err = mlxsw_core_skb_transmit(mlxsw_sp->core, skb, &tx_info); in mlxsw_sp_port_xmit()
778 static u16 mlxsw_sp_pg_buf_threshold_get(const struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_pg_buf_threshold_get() argument
781 return 2 * mlxsw_sp_bytes_cells(mlxsw_sp, mtu); in mlxsw_sp_pg_buf_threshold_get()
786 static u16 mlxsw_sp_pfc_delay_get(const struct mlxsw_sp *mlxsw_sp, int mtu, in mlxsw_sp_pfc_delay_get() argument
789 delay = mlxsw_sp_bytes_cells(mlxsw_sp, DIV_ROUND_UP(delay, in mlxsw_sp_pfc_delay_get()
791 return MLXSW_SP_CELL_FACTOR * delay + mlxsw_sp_bytes_cells(mlxsw_sp, in mlxsw_sp_pfc_delay_get()
800 static u16 mlxsw_sp_pg_buf_delay_get(const struct mlxsw_sp *mlxsw_sp, int mtu, in mlxsw_sp_pg_buf_delay_get() argument
804 return mlxsw_sp_pfc_delay_get(mlxsw_sp, mtu, delay); in mlxsw_sp_pg_buf_delay_get()
806 return mlxsw_sp_bytes_cells(mlxsw_sp, MLXSW_SP_PAUSE_DELAY); in mlxsw_sp_pg_buf_delay_get()
825 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in __mlxsw_sp_port_headroom_set() local
832 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl); in __mlxsw_sp_port_headroom_set()
854 thres = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu); in __mlxsw_sp_port_headroom_set()
855 delay = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay, pfc, in __mlxsw_sp_port_headroom_set()
860 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl); in __mlxsw_sp_port_headroom_set()
960 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_get_stats_raw() local
963 return mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ppcnt), ppcnt_pl); in mlxsw_sp_port_get_stats_raw()
1082 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in __mlxsw_sp_port_vlan_set() local
1092 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spvm), spvm_pl); in __mlxsw_sp_port_vlan_set()
1234 return mlxsw_core_port_get_phys_port_name(mlxsw_sp_port->mlxsw_sp->core, in mlxsw_sp_port_get_phys_port_name()
1425 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_acl_block_mlxsw_sp(acl_block); in mlxsw_sp_setup_tc_cls_flower() local
1429 return mlxsw_sp_flower_replace(mlxsw_sp, acl_block, f); in mlxsw_sp_setup_tc_cls_flower()
1431 mlxsw_sp_flower_destroy(mlxsw_sp, acl_block, f); in mlxsw_sp_setup_tc_cls_flower()
1434 return mlxsw_sp_flower_stats(mlxsw_sp, acl_block, f); in mlxsw_sp_setup_tc_cls_flower()
1436 return mlxsw_sp_flower_tmplt_create(mlxsw_sp, acl_block, f); in mlxsw_sp_setup_tc_cls_flower()
1438 mlxsw_sp_flower_tmplt_destroy(mlxsw_sp, acl_block, f); in mlxsw_sp_setup_tc_cls_flower()
1505 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_setup_tc_block_flower_bind() local
1511 mlxsw_sp); in mlxsw_sp_setup_tc_block_flower_bind()
1513 acl_block = mlxsw_sp_acl_block_create(mlxsw_sp, block->net); in mlxsw_sp_setup_tc_block_flower_bind()
1518 mlxsw_sp, acl_block, extack); in mlxsw_sp_setup_tc_block_flower_bind()
1527 err = mlxsw_sp_acl_block_bind(mlxsw_sp, acl_block, in mlxsw_sp_setup_tc_block_flower_bind()
1552 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_setup_tc_block_flower_unbind() local
1558 mlxsw_sp); in mlxsw_sp_setup_tc_block_flower_unbind()
1568 err = mlxsw_sp_acl_block_unbind(mlxsw_sp, acl_block, in mlxsw_sp_setup_tc_block_flower_unbind()
1711 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_get_drvinfo() local
1713 strlcpy(drvinfo->driver, mlxsw_sp->bus_info->device_kind, in mlxsw_sp_port_get_drvinfo()
1719 mlxsw_sp->bus_info->fw_rev.major, in mlxsw_sp_port_get_drvinfo()
1720 mlxsw_sp->bus_info->fw_rev.minor, in mlxsw_sp_port_get_drvinfo()
1721 mlxsw_sp->bus_info->fw_rev.subminor); in mlxsw_sp_port_get_drvinfo()
1722 strlcpy(drvinfo->bus_info, mlxsw_sp->bus_info->device_name, in mlxsw_sp_port_get_drvinfo()
1744 return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pfcc), in mlxsw_sp_port_pause_set()
2034 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_set_phys_id() local
2050 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mlcr), mlcr_pl); in mlxsw_sp_port_set_phys_id()
2086 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in __mlxsw_sp_port_get_stats() local
2100 data[data_index + i] = mlxsw_sp_cells_bytes(mlxsw_sp, in __mlxsw_sp_port_get_stats()
2436 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_get_link_ksettings() local
2444 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); in mlxsw_sp_port_get_link_ksettings()
2471 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_set_link_ksettings() local
2478 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); in mlxsw_sp_port_set_link_ksettings()
2496 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); in mlxsw_sp_port_set_link_ksettings()
2515 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_flash_device() local
2528 err = mlxsw_sp_firmware_flash(mlxsw_sp, firmware); in mlxsw_sp_flash_device()
2544 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_query_module_eeprom() local
2567 err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcia), mcia_pl); in mlxsw_sp_query_module_eeprom()
2699 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_speed_by_width_set() local
2707 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); in mlxsw_sp_port_speed_by_width_set()
2714 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_ets_set() local
2722 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl); in mlxsw_sp_port_ets_set()
2729 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_ets_maxrate_set() local
2736 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl); in mlxsw_sp_port_ets_maxrate_set()
2742 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_prio_tc_set() local
2747 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qtct), qtct_pl); in mlxsw_sp_port_prio_tc_set()
2822 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_tc_mc_mode_set() local
2826 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qtctm), qtctm_pl); in mlxsw_sp_port_tc_mc_mode_set()
2829 static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port, in mlxsw_sp_port_create() argument
2837 err = mlxsw_core_port_init(mlxsw_sp->core, local_port); in mlxsw_sp_port_create()
2839 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to init core port\n", in mlxsw_sp_port_create()
2849 SET_NETDEV_DEV(dev, mlxsw_sp->bus_info->dev); in mlxsw_sp_port_create()
2852 mlxsw_sp_port->mlxsw_sp = mlxsw_sp; in mlxsw_sp_port_create()
2885 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to map module\n", in mlxsw_sp_port_create()
2892 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set SWID\n", in mlxsw_sp_port_create()
2899 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Unable to init port mac address\n", in mlxsw_sp_port_create()
2920 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set system port mapping\n", in mlxsw_sp_port_create()
2927 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to enable speeds\n", in mlxsw_sp_port_create()
2934 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set MTU\n", in mlxsw_sp_port_create()
2945 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize buffers\n", in mlxsw_sp_port_create()
2952 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize ETS\n", in mlxsw_sp_port_create()
2959 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize TC MC mode\n", in mlxsw_sp_port_create()
2967 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize DCB\n", in mlxsw_sp_port_create()
2974 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize FIDs\n", in mlxsw_sp_port_create()
2981 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize TC qdiscs\n", in mlxsw_sp_port_create()
2988 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to create VID 1\n", in mlxsw_sp_port_create()
2995 mlxsw_sp->ports[local_port] = mlxsw_sp_port; in mlxsw_sp_port_create()
2998 dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to register netdev\n", in mlxsw_sp_port_create()
3003 mlxsw_core_port_eth_set(mlxsw_sp->core, mlxsw_sp_port->local_port, in mlxsw_sp_port_create()
3010 mlxsw_sp->ports[local_port] = NULL; in mlxsw_sp_port_create()
3039 mlxsw_core_port_fini(mlxsw_sp->core, local_port); in mlxsw_sp_port_create()
3043 static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port) in mlxsw_sp_port_remove() argument
3045 struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_port_remove()
3048 mlxsw_core_port_clear(mlxsw_sp->core, local_port, mlxsw_sp); in mlxsw_sp_port_remove()
3050 mlxsw_sp->ports[local_port] = NULL; in mlxsw_sp_port_remove()
3063 mlxsw_core_port_fini(mlxsw_sp->core, local_port); in mlxsw_sp_port_remove()
3066 static bool mlxsw_sp_port_created(struct mlxsw_sp *mlxsw_sp, u8 local_port) in mlxsw_sp_port_created() argument
3068 return mlxsw_sp->ports[local_port] != NULL; in mlxsw_sp_port_created()
3071 static void mlxsw_sp_ports_remove(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_ports_remove() argument
3075 for (i = 1; i < mlxsw_core_max_ports(mlxsw_sp->core); i++) in mlxsw_sp_ports_remove()
3076 if (mlxsw_sp_port_created(mlxsw_sp, i)) in mlxsw_sp_ports_remove()
3077 mlxsw_sp_port_remove(mlxsw_sp, i); in mlxsw_sp_ports_remove()
3078 kfree(mlxsw_sp->port_to_module); in mlxsw_sp_ports_remove()
3079 kfree(mlxsw_sp->ports); in mlxsw_sp_ports_remove()
3082 static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_ports_create() argument
3084 unsigned int max_ports = mlxsw_core_max_ports(mlxsw_sp->core); in mlxsw_sp_ports_create()
3091 mlxsw_sp->ports = kzalloc(alloc_size, GFP_KERNEL); in mlxsw_sp_ports_create()
3092 if (!mlxsw_sp->ports) in mlxsw_sp_ports_create()
3095 mlxsw_sp->port_to_module = kmalloc_array(max_ports, sizeof(int), in mlxsw_sp_ports_create()
3097 if (!mlxsw_sp->port_to_module) { in mlxsw_sp_ports_create()
3104 mlxsw_sp->port_to_module[i] = -1; in mlxsw_sp_ports_create()
3106 err = mlxsw_sp_port_module_info_get(mlxsw_sp, i, &module, in mlxsw_sp_ports_create()
3112 mlxsw_sp->port_to_module[i] = module; in mlxsw_sp_ports_create()
3113 err = mlxsw_sp_port_create(mlxsw_sp, i, false, in mlxsw_sp_ports_create()
3123 if (mlxsw_sp_port_created(mlxsw_sp, i)) in mlxsw_sp_ports_create()
3124 mlxsw_sp_port_remove(mlxsw_sp, i); in mlxsw_sp_ports_create()
3125 kfree(mlxsw_sp->port_to_module); in mlxsw_sp_ports_create()
3127 kfree(mlxsw_sp->ports); in mlxsw_sp_ports_create()
3138 static int mlxsw_sp_port_split_create(struct mlxsw_sp *mlxsw_sp, u8 base_port, in mlxsw_sp_port_split_create() argument
3145 err = mlxsw_sp_port_create(mlxsw_sp, base_port + i, true, in mlxsw_sp_port_split_create()
3155 if (mlxsw_sp_port_created(mlxsw_sp, base_port + i)) in mlxsw_sp_port_split_create()
3156 mlxsw_sp_port_remove(mlxsw_sp, base_port + i); in mlxsw_sp_port_split_create()
3160 static void mlxsw_sp_port_unsplit_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_port_unsplit_create() argument
3173 if (mlxsw_sp->port_to_module[local_port] < 0) in mlxsw_sp_port_unsplit_create()
3175 module = mlxsw_sp->port_to_module[local_port]; in mlxsw_sp_port_unsplit_create()
3177 mlxsw_sp_port_create(mlxsw_sp, local_port, false, module, in mlxsw_sp_port_unsplit_create()
3186 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_port_split() local
3192 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_port_split()
3194 dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n", in mlxsw_sp_port_split()
3218 if (mlxsw_sp->ports[base_port + 1]) { in mlxsw_sp_port_split()
3225 if (mlxsw_sp->ports[base_port + 1] || in mlxsw_sp_port_split()
3226 mlxsw_sp->ports[base_port + 3]) { in mlxsw_sp_port_split()
3234 if (mlxsw_sp_port_created(mlxsw_sp, base_port + i)) in mlxsw_sp_port_split()
3235 mlxsw_sp_port_remove(mlxsw_sp, base_port + i); in mlxsw_sp_port_split()
3237 err = mlxsw_sp_port_split_create(mlxsw_sp, base_port, module, count); in mlxsw_sp_port_split()
3239 dev_err(mlxsw_sp->bus_info->dev, "Failed to create split ports\n"); in mlxsw_sp_port_split()
3246 mlxsw_sp_port_unsplit_create(mlxsw_sp, base_port, count); in mlxsw_sp_port_split()
3253 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_port_unsplit() local
3259 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_port_unsplit()
3261 dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n", in mlxsw_sp_port_unsplit()
3283 if (mlxsw_sp_port_created(mlxsw_sp, base_port + i)) in mlxsw_sp_port_unsplit()
3284 mlxsw_sp_port_remove(mlxsw_sp, base_port + i); in mlxsw_sp_port_unsplit()
3286 mlxsw_sp_port_unsplit_create(mlxsw_sp, base_port, count); in mlxsw_sp_port_unsplit()
3294 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_pude_event_func() local
3300 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_pude_event_func()
3317 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_rx_listener_no_mark_func() local
3318 struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_rx_listener_no_mark_func()
3322 dev_warn_ratelimited(mlxsw_sp->bus_info->dev, "Port %d: skb received for non-existent port\n", in mlxsw_sp_rx_listener_no_mark_func()
3357 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_rx_listener_sample_func() local
3358 struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp_rx_listener_sample_func()
3363 …dev_warn_ratelimited(mlxsw_sp->bus_info->dev, "Port %d: sample skb received for non-existent port\… in mlxsw_sp_rx_listener_sample_func()
3368 …dev_warn_ratelimited(mlxsw_sp->bus_info->dev, "Port %d: sample skb received on unsupported port\n", in mlxsw_sp_rx_listener_sample_func()
3613 static int mlxsw_sp_traps_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_traps_init() argument
3618 err = mlxsw_sp_cpu_policers_set(mlxsw_sp->core); in mlxsw_sp_traps_init()
3622 err = mlxsw_sp_trap_groups_set(mlxsw_sp->core); in mlxsw_sp_traps_init()
3627 err = mlxsw_core_trap_register(mlxsw_sp->core, in mlxsw_sp_traps_init()
3629 mlxsw_sp); in mlxsw_sp_traps_init()
3638 mlxsw_core_trap_unregister(mlxsw_sp->core, in mlxsw_sp_traps_init()
3640 mlxsw_sp); in mlxsw_sp_traps_init()
3645 static void mlxsw_sp_traps_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_traps_fini() argument
3650 mlxsw_core_trap_unregister(mlxsw_sp->core, in mlxsw_sp_traps_fini()
3652 mlxsw_sp); in mlxsw_sp_traps_fini()
3656 static int mlxsw_sp_lag_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_lag_init() argument
3670 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcr), slcr_pl); in mlxsw_sp_lag_init()
3674 if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_LAG) || in mlxsw_sp_lag_init()
3675 !MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_LAG_MEMBERS)) in mlxsw_sp_lag_init()
3678 mlxsw_sp->lags = kcalloc(MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_LAG), in mlxsw_sp_lag_init()
3681 if (!mlxsw_sp->lags) in mlxsw_sp_lag_init()
3687 static void mlxsw_sp_lag_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_lag_fini() argument
3689 kfree(mlxsw_sp->lags); in mlxsw_sp_lag_fini()
3709 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_init() local
3712 mlxsw_sp->core = mlxsw_core; in mlxsw_sp_init()
3713 mlxsw_sp->bus_info = mlxsw_bus_info; in mlxsw_sp_init()
3715 err = mlxsw_sp_fw_rev_validate(mlxsw_sp); in mlxsw_sp_init()
3719 err = mlxsw_sp_base_mac_get(mlxsw_sp); in mlxsw_sp_init()
3721 dev_err(mlxsw_sp->bus_info->dev, "Failed to get base mac\n"); in mlxsw_sp_init()
3725 err = mlxsw_sp_kvdl_init(mlxsw_sp); in mlxsw_sp_init()
3727 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize KVDL\n"); in mlxsw_sp_init()
3731 err = mlxsw_sp_fids_init(mlxsw_sp); in mlxsw_sp_init()
3733 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize FIDs\n"); in mlxsw_sp_init()
3737 err = mlxsw_sp_traps_init(mlxsw_sp); in mlxsw_sp_init()
3739 dev_err(mlxsw_sp->bus_info->dev, "Failed to set traps\n"); in mlxsw_sp_init()
3743 err = mlxsw_sp_buffers_init(mlxsw_sp); in mlxsw_sp_init()
3745 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize buffers\n"); in mlxsw_sp_init()
3749 err = mlxsw_sp_lag_init(mlxsw_sp); in mlxsw_sp_init()
3751 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize LAG\n"); in mlxsw_sp_init()
3758 err = mlxsw_sp_span_init(mlxsw_sp); in mlxsw_sp_init()
3760 dev_err(mlxsw_sp->bus_info->dev, "Failed to init span system\n"); in mlxsw_sp_init()
3764 err = mlxsw_sp_switchdev_init(mlxsw_sp); in mlxsw_sp_init()
3766 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize switchdev\n"); in mlxsw_sp_init()
3770 err = mlxsw_sp_counter_pool_init(mlxsw_sp); in mlxsw_sp_init()
3772 dev_err(mlxsw_sp->bus_info->dev, "Failed to init counter pool\n"); in mlxsw_sp_init()
3776 err = mlxsw_sp_afa_init(mlxsw_sp); in mlxsw_sp_init()
3778 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize ACL actions\n"); in mlxsw_sp_init()
3782 err = mlxsw_sp_router_init(mlxsw_sp); in mlxsw_sp_init()
3784 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize router\n"); in mlxsw_sp_init()
3792 mlxsw_sp->netdevice_nb.notifier_call = mlxsw_sp_netdevice_event; in mlxsw_sp_init()
3793 err = register_netdevice_notifier(&mlxsw_sp->netdevice_nb); in mlxsw_sp_init()
3795 dev_err(mlxsw_sp->bus_info->dev, "Failed to register netdev notifier\n"); in mlxsw_sp_init()
3799 err = mlxsw_sp_acl_init(mlxsw_sp); in mlxsw_sp_init()
3801 dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize ACL\n"); in mlxsw_sp_init()
3805 err = mlxsw_sp_dpipe_init(mlxsw_sp); in mlxsw_sp_init()
3807 dev_err(mlxsw_sp->bus_info->dev, "Failed to init pipeline debug\n"); in mlxsw_sp_init()
3811 err = mlxsw_sp_ports_create(mlxsw_sp); in mlxsw_sp_init()
3813 dev_err(mlxsw_sp->bus_info->dev, "Failed to create ports\n"); in mlxsw_sp_init()
3820 mlxsw_sp_dpipe_fini(mlxsw_sp); in mlxsw_sp_init()
3822 mlxsw_sp_acl_fini(mlxsw_sp); in mlxsw_sp_init()
3824 unregister_netdevice_notifier(&mlxsw_sp->netdevice_nb); in mlxsw_sp_init()
3826 mlxsw_sp_router_fini(mlxsw_sp); in mlxsw_sp_init()
3828 mlxsw_sp_afa_fini(mlxsw_sp); in mlxsw_sp_init()
3830 mlxsw_sp_counter_pool_fini(mlxsw_sp); in mlxsw_sp_init()
3832 mlxsw_sp_switchdev_fini(mlxsw_sp); in mlxsw_sp_init()
3834 mlxsw_sp_span_fini(mlxsw_sp); in mlxsw_sp_init()
3836 mlxsw_sp_lag_fini(mlxsw_sp); in mlxsw_sp_init()
3838 mlxsw_sp_buffers_fini(mlxsw_sp); in mlxsw_sp_init()
3840 mlxsw_sp_traps_fini(mlxsw_sp); in mlxsw_sp_init()
3842 mlxsw_sp_fids_fini(mlxsw_sp); in mlxsw_sp_init()
3844 mlxsw_sp_kvdl_fini(mlxsw_sp); in mlxsw_sp_init()
3851 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp1_init() local
3853 mlxsw_sp->req_rev = &mlxsw_sp1_fw_rev; in mlxsw_sp1_init()
3854 mlxsw_sp->fw_filename = MLXSW_SP1_FW_FILENAME; in mlxsw_sp1_init()
3855 mlxsw_sp->kvdl_ops = &mlxsw_sp1_kvdl_ops; in mlxsw_sp1_init()
3856 mlxsw_sp->afa_ops = &mlxsw_sp1_act_afa_ops; in mlxsw_sp1_init()
3857 mlxsw_sp->afk_ops = &mlxsw_sp1_afk_ops; in mlxsw_sp1_init()
3858 mlxsw_sp->mr_tcam_ops = &mlxsw_sp1_mr_tcam_ops; in mlxsw_sp1_init()
3859 mlxsw_sp->acl_tcam_ops = &mlxsw_sp1_acl_tcam_ops; in mlxsw_sp1_init()
3867 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp2_init() local
3869 mlxsw_sp->kvdl_ops = &mlxsw_sp2_kvdl_ops; in mlxsw_sp2_init()
3870 mlxsw_sp->afa_ops = &mlxsw_sp2_act_afa_ops; in mlxsw_sp2_init()
3871 mlxsw_sp->afk_ops = &mlxsw_sp2_afk_ops; in mlxsw_sp2_init()
3872 mlxsw_sp->mr_tcam_ops = &mlxsw_sp2_mr_tcam_ops; in mlxsw_sp2_init()
3873 mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops; in mlxsw_sp2_init()
3880 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_fini() local
3882 mlxsw_sp_ports_remove(mlxsw_sp); in mlxsw_sp_fini()
3883 mlxsw_sp_dpipe_fini(mlxsw_sp); in mlxsw_sp_fini()
3884 mlxsw_sp_acl_fini(mlxsw_sp); in mlxsw_sp_fini()
3885 unregister_netdevice_notifier(&mlxsw_sp->netdevice_nb); in mlxsw_sp_fini()
3886 mlxsw_sp_router_fini(mlxsw_sp); in mlxsw_sp_fini()
3887 mlxsw_sp_afa_fini(mlxsw_sp); in mlxsw_sp_fini()
3888 mlxsw_sp_counter_pool_fini(mlxsw_sp); in mlxsw_sp_fini()
3889 mlxsw_sp_switchdev_fini(mlxsw_sp); in mlxsw_sp_fini()
3890 mlxsw_sp_span_fini(mlxsw_sp); in mlxsw_sp_fini()
3891 mlxsw_sp_lag_fini(mlxsw_sp); in mlxsw_sp_fini()
3892 mlxsw_sp_buffers_fini(mlxsw_sp); in mlxsw_sp_fini()
3893 mlxsw_sp_traps_fini(mlxsw_sp); in mlxsw_sp_fini()
3894 mlxsw_sp_fids_fini(mlxsw_sp); in mlxsw_sp_fini()
3895 mlxsw_sp_kvdl_fini(mlxsw_sp); in mlxsw_sp_fini()
4115 .priv_size = sizeof(struct mlxsw_sp),
4141 .priv_size = sizeof(struct mlxsw_sp),
4195 struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev) in mlxsw_sp_lower_get()
4200 return mlxsw_sp_port ? mlxsw_sp_port->mlxsw_sp : NULL; in mlxsw_sp_lower_get()
4234 static int mlxsw_sp_lag_create(struct mlxsw_sp *mlxsw_sp, u16 lag_id) in mlxsw_sp_lag_create() argument
4239 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); in mlxsw_sp_lag_create()
4242 static int mlxsw_sp_lag_destroy(struct mlxsw_sp *mlxsw_sp, u16 lag_id) in mlxsw_sp_lag_destroy() argument
4247 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); in mlxsw_sp_lag_destroy()
4253 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_lag_col_port_add() local
4258 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); in mlxsw_sp_lag_col_port_add()
4264 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_lag_col_port_remove() local
4269 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); in mlxsw_sp_lag_col_port_remove()
4275 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_lag_col_port_enable() local
4280 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); in mlxsw_sp_lag_col_port_enable()
4286 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_lag_col_port_disable() local
4291 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); in mlxsw_sp_lag_col_port_disable()
4294 static int mlxsw_sp_lag_index_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_lag_index_get() argument
4303 max_lag = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_LAG); in mlxsw_sp_lag_index_get()
4305 lag = mlxsw_sp_lag_get(mlxsw_sp, i); in mlxsw_sp_lag_index_get()
4322 mlxsw_sp_master_lag_check(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_master_lag_check() argument
4329 if (mlxsw_sp_lag_index_get(mlxsw_sp, lag_dev, &lag_id) != 0) { in mlxsw_sp_master_lag_check()
4340 static int mlxsw_sp_port_lag_index_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_port_lag_index_get() argument
4346 max_lag_members = MLXSW_CORE_RES_GET(mlxsw_sp->core, in mlxsw_sp_port_lag_index_get()
4349 if (!mlxsw_sp_port_lagged_get(mlxsw_sp, lag_id, i)) { in mlxsw_sp_port_lag_index_get()
4360 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_lag_join() local
4367 err = mlxsw_sp_lag_index_get(mlxsw_sp, lag_dev, &lag_id); in mlxsw_sp_port_lag_join()
4370 lag = mlxsw_sp_lag_get(mlxsw_sp, lag_id); in mlxsw_sp_port_lag_join()
4372 err = mlxsw_sp_lag_create(mlxsw_sp, lag_id); in mlxsw_sp_port_lag_join()
4378 err = mlxsw_sp_port_lag_index_get(mlxsw_sp, lag_id, &port_index); in mlxsw_sp_port_lag_join()
4388 mlxsw_core_lag_mapping_set(mlxsw_sp->core, lag_id, port_index, in mlxsw_sp_port_lag_join()
4405 mlxsw_sp_lag_destroy(mlxsw_sp, lag_id); in mlxsw_sp_port_lag_join()
4412 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_lag_leave() local
4418 lag = mlxsw_sp_lag_get(mlxsw_sp, lag_id); in mlxsw_sp_port_lag_leave()
4428 mlxsw_sp_lag_destroy(mlxsw_sp, lag_id); in mlxsw_sp_port_lag_leave()
4430 mlxsw_core_lag_mapping_clear(mlxsw_sp->core, lag_id, in mlxsw_sp_port_lag_leave()
4443 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_lag_dist_port_add() local
4448 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); in mlxsw_sp_lag_dist_port_add()
4454 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_lag_dist_port_remove() local
4459 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); in mlxsw_sp_lag_dist_port_remove()
4482 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_port_stp_set() local
4499 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spms), spms_pl); in mlxsw_sp_port_stp_set()
4561 struct mlxsw_sp *mlxsw_sp; in mlxsw_sp_netdevice_port_upper_event() local
4565 mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_netdevice_port_upper_event()
4584 !mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp, in mlxsw_sp_netdevice_port_upper_event()
4590 !mlxsw_sp_master_lag_check(mlxsw_sp, upper_dev, in mlxsw_sp_netdevice_port_upper_event()
4603 !mlxsw_sp_rif_find_by_dev(mlxsw_sp, lower_dev)) { in mlxsw_sp_netdevice_port_upper_event()
4647 mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); in mlxsw_sp_netdevice_port_upper_event()
4721 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_netdevice_port_vlan_event() local
4741 !mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp, in mlxsw_sp_netdevice_port_vlan_event()
4747 !mlxsw_sp_rif_find_by_dev(mlxsw_sp, vlan_dev)) { in mlxsw_sp_netdevice_port_vlan_event()
4766 mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); in mlxsw_sp_netdevice_port_vlan_event()
4819 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(br_dev); in mlxsw_sp_netdevice_bridge_event() local
4824 if (!mlxsw_sp) in mlxsw_sp_netdevice_bridge_event()
4839 !mlxsw_sp_rif_find_by_dev(mlxsw_sp, br_dev)) { in mlxsw_sp_netdevice_bridge_event()
4849 mlxsw_sp_rif_destroy_by_dev(mlxsw_sp, upper_dev); in mlxsw_sp_netdevice_bridge_event()
4851 mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); in mlxsw_sp_netdevice_bridge_event()
4861 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(macvlan_dev); in mlxsw_sp_netdevice_macvlan_event() local
4865 if (!mlxsw_sp || event != NETDEV_PRECHANGEUPPER) in mlxsw_sp_netdevice_macvlan_event()
4890 struct mlxsw_sp *mlxsw_sp; in mlxsw_sp_netdevice_event() local
4893 mlxsw_sp = container_of(nb, struct mlxsw_sp, netdevice_nb); in mlxsw_sp_netdevice_event()
4895 span_entry = mlxsw_sp_span_entry_find_by_port(mlxsw_sp, dev); in mlxsw_sp_netdevice_event()
4897 mlxsw_sp_span_entry_invalidate(mlxsw_sp, span_entry); in mlxsw_sp_netdevice_event()
4899 mlxsw_sp_span_respin(mlxsw_sp); in mlxsw_sp_netdevice_event()
4901 if (mlxsw_sp_netdev_is_ipip_ol(mlxsw_sp, dev)) in mlxsw_sp_netdevice_event()
4902 err = mlxsw_sp_netdevice_ipip_ol_event(mlxsw_sp, dev, in mlxsw_sp_netdevice_event()
4904 else if (mlxsw_sp_netdev_is_ipip_ul(mlxsw_sp, dev)) in mlxsw_sp_netdevice_event()
4905 err = mlxsw_sp_netdevice_ipip_ul_event(mlxsw_sp, dev, in mlxsw_sp_netdevice_event()