mlxsw_sp 148 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 153 drivers/net/ethernet/mellanox/mlxsw/spectrum.c (*clock_init)(struct mlxsw_sp *mlxsw_sp, struct device *dev); mlxsw_sp 156 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp_ptp_state *(*init)(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 162 drivers/net/ethernet/mellanox/mlxsw/spectrum.c void (*receive)(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, mlxsw_sp 168 drivers/net/ethernet/mellanox/mlxsw/spectrum.c void (*transmitted)(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, mlxsw_sp 176 drivers/net/ethernet/mellanox/mlxsw/spectrum.c int (*get_ts_info)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 190 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 195 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcqi), mcqi_pl); mlxsw_sp 211 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 217 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 228 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 237 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 242 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 251 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 255 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcda), mcda_pl); mlxsw_sp 263 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 268 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 275 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 280 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 289 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 296 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 311 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 316 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 323 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 329 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mcc), mcc_pl); mlxsw_sp 338 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_mlxfw_dev->mlxsw_sp; mlxsw_sp 340 drivers/net/ethernet/mellanox/mlxsw/spectrum.c devlink_flash_update_status_notify(priv_to_devlink(mlxsw_sp->core), mlxsw_sp 358 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_firmware_flash(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 365 drivers/net/ethernet/mellanox/mlxsw/spectrum.c .psid = mlxsw_sp->bus_info->psid, mlxsw_sp 366 drivers/net/ethernet/mellanox/mlxsw/spectrum.c .psid_size = strlen(mlxsw_sp->bus_info->psid), mlxsw_sp 368 drivers/net/ethernet/mellanox/mlxsw/spectrum.c .mlxsw_sp = mlxsw_sp mlxsw_sp 372 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_fw_flash_start(mlxsw_sp->core); mlxsw_sp 373 drivers/net/ethernet/mellanox/mlxsw/spectrum.c devlink_flash_update_begin_notify(priv_to_devlink(mlxsw_sp->core)); mlxsw_sp 376 drivers/net/ethernet/mellanox/mlxsw/spectrum.c devlink_flash_update_end_notify(priv_to_devlink(mlxsw_sp->core)); mlxsw_sp 377 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_fw_flash_end(mlxsw_sp->core); mlxsw_sp 382 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_fw_rev_validate(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 384 drivers/net/ethernet/mellanox/mlxsw/spectrum.c const struct mlxsw_fw_rev *rev = &mlxsw_sp->bus_info->fw_rev; mlxsw_sp 385 drivers/net/ethernet/mellanox/mlxsw/spectrum.c const struct mlxsw_fw_rev *req_rev = mlxsw_sp->req_rev; mlxsw_sp 386 drivers/net/ethernet/mellanox/mlxsw/spectrum.c const char *fw_filename = mlxsw_sp->fw_filename; mlxsw_sp 396 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = devlink_param_driverinit_value_get(priv_to_devlink(mlxsw_sp->core), mlxsw_sp 417 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_info(mlxsw_sp->bus_info->dev, "The firmware version %d.%d.%d is incompatible with the driver\n", mlxsw_sp 419 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_info(mlxsw_sp->bus_info->dev, "Flashing firmware using file %s\n", mlxsw_sp 423 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->bus_info->dev); mlxsw_sp 425 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Could not request firmware file %s\n", mlxsw_sp 430 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_firmware_flash(mlxsw_sp, firmware, NULL); mlxsw_sp 433 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Could not upgrade firmware\n"); mlxsw_sp 448 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 456 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->bus_info->dev); mlxsw_sp 459 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_firmware_flash(mlxsw_sp, firmware, extack); mlxsw_sp 465 drivers/net/ethernet/mellanox/mlxsw/spectrum.c int mlxsw_sp_flow_counter_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 474 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mgpc), mgpc_pl); mlxsw_sp 484 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_flow_counter_clear(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 491 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mgpc), mgpc_pl); mlxsw_sp 494 drivers/net/ethernet/mellanox/mlxsw/spectrum.c int mlxsw_sp_flow_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 499 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_counter_alloc(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_FLOW, mlxsw_sp 503 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_flow_counter_clear(mlxsw_sp, *p_counter_index); mlxsw_sp 509 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_counter_free(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_FLOW, mlxsw_sp 514 drivers/net/ethernet/mellanox/mlxsw/spectrum.c void mlxsw_sp_flow_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 517 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_counter_free(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_FLOW, mlxsw_sp 557 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 567 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spms), spms_pl); mlxsw_sp 572 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_base_mac_get(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 577 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(spad), spad_pl); mlxsw_sp 580 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_reg_spad_base_mac_memcpy_from(spad_pl, mlxsw_sp->base_mac); mlxsw_sp 587 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 591 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpsc), mpsc_pl); mlxsw_sp 597 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 603 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(paos), paos_pl); mlxsw_sp 609 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 614 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ppad), ppad_pl); mlxsw_sp 619 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 622 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ether_addr_copy(addr, mlxsw_sp->base_mac); mlxsw_sp 629 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 636 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pmtu), pmtu_pl); mlxsw_sp 645 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pmtu), pmtu_pl); mlxsw_sp 650 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 654 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pspa), pspa_pl); mlxsw_sp 659 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 663 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(svpe), svpe_pl); mlxsw_sp 669 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 678 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spvmlr), spvmlr_pl); mlxsw_sp 686 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 690 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spvid), spvid_pl); mlxsw_sp 696 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 700 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spaft), spaft_pl); mlxsw_sp 731 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 735 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sspr), sspr_pl); mlxsw_sp 738 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_port_module_info_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 746 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pmlp), pmlp_pl); mlxsw_sp 758 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 769 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pmlp), pmlp_pl); mlxsw_sp 774 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 779 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pmlp), pmlp_pl); mlxsw_sp 806 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 823 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info)) mlxsw_sp 840 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_core_skb_transmit(mlxsw_sp->core, skb, &tx_info); mlxsw_sp 875 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static u16 mlxsw_sp_pg_buf_threshold_get(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 878 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return 2 * mlxsw_sp_bytes_cells(mlxsw_sp, mtu); mlxsw_sp 883 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static u16 mlxsw_sp_pfc_delay_get(const struct mlxsw_sp *mlxsw_sp, int mtu, mlxsw_sp 886 drivers/net/ethernet/mellanox/mlxsw/spectrum.c delay = mlxsw_sp_bytes_cells(mlxsw_sp, DIV_ROUND_UP(delay, mlxsw_sp 888 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return MLXSW_SP_CELL_FACTOR * delay + mlxsw_sp_bytes_cells(mlxsw_sp, mlxsw_sp 897 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static u16 mlxsw_sp_pg_buf_delay_get(const struct mlxsw_sp *mlxsw_sp, int mtu, mlxsw_sp 901 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_pfc_delay_get(mlxsw_sp, mtu, delay); mlxsw_sp 903 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_bytes_cells(mlxsw_sp, MLXSW_SP_PAUSE_DELAY); mlxsw_sp 922 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 930 drivers/net/ethernet/mellanox/mlxsw/spectrum.c max_headroom_cells = mlxsw_sp_sb_max_headroom_cells(mlxsw_sp); mlxsw_sp 933 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl); mlxsw_sp 957 drivers/net/ethernet/mellanox/mlxsw/spectrum.c thres_cells = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu); mlxsw_sp 958 drivers/net/ethernet/mellanox/mlxsw/spectrum.c delay_cells = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay, mlxsw_sp 970 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl); mlxsw_sp 1070 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1073 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ppcnt), ppcnt_pl); mlxsw_sp 1195 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1205 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spvm), spvm_pl); mlxsw_sp 1515 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_acl_block_mlxsw_sp(acl_block); mlxsw_sp 1519 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_flower_replace(mlxsw_sp, acl_block, f); mlxsw_sp 1521 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_flower_destroy(mlxsw_sp, acl_block, f); mlxsw_sp 1524 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_flower_stats(mlxsw_sp, acl_block, f); mlxsw_sp 1526 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_flower_tmplt_create(mlxsw_sp, acl_block, f); mlxsw_sp 1528 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_flower_tmplt_destroy(mlxsw_sp, acl_block, f); mlxsw_sp 1603 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1611 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp); mlxsw_sp 1613 drivers/net/ethernet/mellanox/mlxsw/spectrum.c acl_block = mlxsw_sp_acl_block_create(mlxsw_sp, f->net); mlxsw_sp 1617 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp, acl_block, mlxsw_sp 1629 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_acl_block_bind(mlxsw_sp, acl_block, mlxsw_sp 1657 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1664 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp); mlxsw_sp 1674 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_acl_block_unbind(mlxsw_sp, acl_block, mlxsw_sp 1784 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pplr), mlxsw_sp 1844 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1846 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_core_port_devlink_port_get(mlxsw_sp->core, mlxsw_sp 1859 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_port->mlxsw_sp->ptp_ops->hwtstamp_set(mlxsw_sp_port, mlxsw_sp 1876 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_port->mlxsw_sp->ptp_ops->hwtstamp_get(mlxsw_sp_port, mlxsw_sp 1891 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port->mlxsw_sp->ptp_ops->hwtstamp_set(mlxsw_sp_port, &config); mlxsw_sp 1931 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1933 drivers/net/ethernet/mellanox/mlxsw/spectrum.c strlcpy(drvinfo->driver, mlxsw_sp->bus_info->device_kind, mlxsw_sp 1939 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->bus_info->fw_rev.major, mlxsw_sp 1940 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->bus_info->fw_rev.minor, mlxsw_sp 1941 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->bus_info->fw_rev.subminor); mlxsw_sp 1942 drivers/net/ethernet/mellanox/mlxsw/spectrum.c strlcpy(drvinfo->bus_info, mlxsw_sp->bus_info->device_name, mlxsw_sp 1964 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pfcc), mlxsw_sp 2375 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port->mlxsw_sp->ptp_ops->get_stats_strings(&p); mlxsw_sp 2384 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 2400 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mlcr), mlcr_pl); mlxsw_sp 2448 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 2462 drivers/net/ethernet/mellanox/mlxsw/spectrum.c data[data_index + i] = mlxsw_sp_cells_bytes(mlxsw_sp, mlxsw_sp 2513 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port->mlxsw_sp->ptp_ops->get_stats(mlxsw_sp_port, mlxsw_sp 2515 drivers/net/ethernet/mellanox/mlxsw/spectrum.c data_index += mlxsw_sp_port->mlxsw_sp->ptp_ops->get_stats_count(); mlxsw_sp 2525 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port->mlxsw_sp->ptp_ops->get_stats_count(); mlxsw_sp 2648 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_from_ptys_supported_port(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2669 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_from_ptys_link(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto, mlxsw_sp 2682 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_from_ptys_speed(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto) mlxsw_sp 2695 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_from_ptys_speed_duplex(struct mlxsw_sp *mlxsw_sp, bool carrier_ok, mlxsw_sp 2705 drivers/net/ethernet/mellanox/mlxsw/spectrum.c cmd->base.speed = mlxsw_sp1_from_ptys_speed(mlxsw_sp, ptys_eth_proto); mlxsw_sp 2711 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_to_ptys_advert_link(struct mlxsw_sp *mlxsw_sp, u8 width, mlxsw_sp 2725 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static u32 mlxsw_sp1_to_ptys_speed(struct mlxsw_sp *mlxsw_sp, u8 width, mlxsw_sp 2739 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_to_ptys_upper_speed(struct mlxsw_sp *mlxsw_sp, u32 upper_speed) mlxsw_sp 2752 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_port_speed_base(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 2760 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_reg_ptys_eth_pack(struct mlxsw_sp *mlxsw_sp, char *payload, mlxsw_sp 2767 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_reg_ptys_eth_unpack(struct mlxsw_sp *mlxsw_sp, char *payload, mlxsw_sp 3044 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_from_ptys_supported_port(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3063 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_from_ptys_link(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto, mlxsw_sp 3078 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_from_ptys_speed(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto) mlxsw_sp 3091 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_from_ptys_speed_duplex(struct mlxsw_sp *mlxsw_sp, bool carrier_ok, mlxsw_sp 3101 drivers/net/ethernet/mellanox/mlxsw/spectrum.c cmd->base.speed = mlxsw_sp2_from_ptys_speed(mlxsw_sp, ptys_eth_proto); mlxsw_sp 3122 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_to_ptys_advert_link(struct mlxsw_sp *mlxsw_sp, u8 width, mlxsw_sp 3138 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static u32 mlxsw_sp2_to_ptys_speed(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3154 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_to_ptys_upper_speed(struct mlxsw_sp *mlxsw_sp, u32 upper_speed) mlxsw_sp 3167 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_port_speed_base(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 3178 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); mlxsw_sp 3199 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_reg_ptys_eth_pack(struct mlxsw_sp *mlxsw_sp, char *payload, mlxsw_sp 3207 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp2_reg_ptys_eth_unpack(struct mlxsw_sp *mlxsw_sp, char *payload, mlxsw_sp 3230 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_get_link_supported(struct mlxsw_sp *mlxsw_sp, u32 eth_proto_cap, mlxsw_sp 3235 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops = mlxsw_sp->port_type_speed_ops; mlxsw_sp 3241 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->from_ptys_supported_port(mlxsw_sp, eth_proto_cap, cmd); mlxsw_sp 3242 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->from_ptys_link(mlxsw_sp, eth_proto_cap, width, mlxsw_sp 3247 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_get_link_advertise(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3253 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops = mlxsw_sp->port_type_speed_ops; mlxsw_sp 3259 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->from_ptys_link(mlxsw_sp, eth_proto_admin, width, mlxsw_sp 3296 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3303 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops = mlxsw_sp->port_type_speed_ops; mlxsw_sp 3306 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->reg_ptys_eth_pack(mlxsw_sp, ptys_pl, mlxsw_sp_port->local_port, mlxsw_sp 3308 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); mlxsw_sp 3311 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->reg_ptys_eth_unpack(mlxsw_sp, ptys_pl, ð_proto_cap, mlxsw_sp 3314 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_get_link_supported(mlxsw_sp, eth_proto_cap, mlxsw_sp 3317 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_get_link_advertise(mlxsw_sp, eth_proto_admin, autoneg, mlxsw_sp 3323 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->from_ptys_speed_duplex(mlxsw_sp, netif_carrier_ok(dev), mlxsw_sp 3334 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3341 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops = mlxsw_sp->port_type_speed_ops; mlxsw_sp 3343 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->reg_ptys_eth_pack(mlxsw_sp, ptys_pl, mlxsw_sp_port->local_port, mlxsw_sp 3345 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); mlxsw_sp 3348 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->reg_ptys_eth_unpack(mlxsw_sp, ptys_pl, ð_proto_cap, NULL, NULL); mlxsw_sp 3352 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->to_ptys_advert_link(mlxsw_sp, mlxsw_sp_port->mapping.width, mlxsw_sp 3354 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->to_ptys_speed(mlxsw_sp, mlxsw_sp_port->mapping.width, mlxsw_sp 3363 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->reg_ptys_eth_pack(mlxsw_sp, ptys_pl, mlxsw_sp_port->local_port, mlxsw_sp 3365 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); mlxsw_sp 3384 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3387 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_env_get_module_info(mlxsw_sp->core, mlxsw_sp 3399 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3402 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_env_get_module_eeprom(netdev, mlxsw_sp->core, mlxsw_sp 3413 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3415 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp->ptp_ops->get_ts_info(mlxsw_sp, info); mlxsw_sp 3437 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3445 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops = mlxsw_sp->port_type_speed_ops; mlxsw_sp 3447 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = ops->port_speed_base(mlxsw_sp, mlxsw_sp_port->local_port, mlxsw_sp 3453 drivers/net/ethernet/mellanox/mlxsw/spectrum.c eth_proto_admin = ops->to_ptys_upper_speed(mlxsw_sp, upper_speed); mlxsw_sp 3454 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ops->reg_ptys_eth_pack(mlxsw_sp, ptys_pl, mlxsw_sp_port->local_port, mlxsw_sp 3456 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); mlxsw_sp 3463 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3471 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl); mlxsw_sp 3478 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3485 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl); mlxsw_sp 3492 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3500 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl); mlxsw_sp 3506 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3511 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qtct), qtct_pl); mlxsw_sp 3604 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 3608 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qtctm), qtctm_pl); mlxsw_sp 3611 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 3619 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_core_port_init(mlxsw_sp->core, local_port, mlxsw_sp 3621 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->base_mac, mlxsw_sp 3622 drivers/net/ethernet/mellanox/mlxsw/spectrum.c sizeof(mlxsw_sp->base_mac)); mlxsw_sp 3624 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to init core port\n", mlxsw_sp 3634 drivers/net/ethernet/mellanox/mlxsw/spectrum.c SET_NETDEV_DEV(dev, mlxsw_sp->bus_info->dev); mlxsw_sp 3637 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port->mlxsw_sp = mlxsw_sp; mlxsw_sp 3670 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to map module\n", mlxsw_sp 3677 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set SWID\n", mlxsw_sp 3684 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Unable to init port mac address\n", mlxsw_sp 3705 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set system port mapping\n", mlxsw_sp 3712 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to enable speeds\n", mlxsw_sp 3719 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set MTU\n", mlxsw_sp 3730 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize buffers\n", mlxsw_sp 3737 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize ETS\n", mlxsw_sp 3744 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize TC MC mode\n", mlxsw_sp 3752 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize DCB\n", mlxsw_sp 3759 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize FIDs\n", mlxsw_sp 3766 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize TC qdiscs\n", mlxsw_sp 3774 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to clear VLAN filter\n", mlxsw_sp 3781 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to initialize NVE\n", mlxsw_sp 3788 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set PVID\n", mlxsw_sp 3796 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to create VID 1\n", mlxsw_sp 3804 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->shaper_work); mlxsw_sp 3806 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports[local_port] = mlxsw_sp_port; mlxsw_sp 3809 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to register netdev\n", mlxsw_sp 3814 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_port_eth_set(mlxsw_sp->core, mlxsw_sp_port->local_port, mlxsw_sp 3820 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports[local_port] = NULL; mlxsw_sp 3852 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_port_fini(mlxsw_sp->core, local_port); mlxsw_sp 3856 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port) mlxsw_sp 3858 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 3863 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_port_clear(mlxsw_sp->core, local_port, mlxsw_sp); mlxsw_sp 3865 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports[local_port] = NULL; mlxsw_sp 3878 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_port_fini(mlxsw_sp->core, local_port); mlxsw_sp 3881 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_cpu_port_create(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3890 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port->mlxsw_sp = mlxsw_sp; mlxsw_sp 3893 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_core_cpu_port_init(mlxsw_sp->core, mlxsw_sp 3895 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->base_mac, mlxsw_sp 3896 drivers/net/ethernet/mellanox/mlxsw/spectrum.c sizeof(mlxsw_sp->base_mac)); mlxsw_sp 3898 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize core CPU port\n"); mlxsw_sp 3902 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports[MLXSW_PORT_CPU_PORT] = mlxsw_sp_port; mlxsw_sp 3910 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp_cpu_port_remove(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3913 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports[MLXSW_PORT_CPU_PORT]; mlxsw_sp 3915 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_cpu_port_fini(mlxsw_sp->core); mlxsw_sp 3916 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports[MLXSW_PORT_CPU_PORT] = NULL; mlxsw_sp 3920 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static bool mlxsw_sp_port_created(struct mlxsw_sp *mlxsw_sp, u8 local_port) mlxsw_sp 3922 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp->ports[local_port] != NULL; mlxsw_sp 3925 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp_ports_remove(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3929 drivers/net/ethernet/mellanox/mlxsw/spectrum.c for (i = 1; i < mlxsw_core_max_ports(mlxsw_sp->core); i++) mlxsw_sp 3930 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp_port_created(mlxsw_sp, i)) mlxsw_sp 3931 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_remove(mlxsw_sp, i); mlxsw_sp 3932 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_cpu_port_remove(mlxsw_sp); mlxsw_sp 3933 drivers/net/ethernet/mellanox/mlxsw/spectrum.c kfree(mlxsw_sp->port_to_module); mlxsw_sp 3934 drivers/net/ethernet/mellanox/mlxsw/spectrum.c kfree(mlxsw_sp->ports); mlxsw_sp 3935 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports = NULL; mlxsw_sp 3938 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3940 drivers/net/ethernet/mellanox/mlxsw/spectrum.c unsigned int max_ports = mlxsw_core_max_ports(mlxsw_sp->core); mlxsw_sp 3947 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports = kzalloc(alloc_size, GFP_KERNEL); mlxsw_sp 3948 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!mlxsw_sp->ports) mlxsw_sp 3951 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->port_to_module = kmalloc_array(max_ports, sizeof(int), mlxsw_sp 3953 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!mlxsw_sp->port_to_module) { mlxsw_sp 3958 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_cpu_port_create(mlxsw_sp); mlxsw_sp 3964 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->port_to_module[i] = -1; mlxsw_sp 3966 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_port_module_info_get(mlxsw_sp, i, &module, mlxsw_sp 3972 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->port_to_module[i] = module; mlxsw_sp 3973 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_port_create(mlxsw_sp, i, false, mlxsw_sp 3983 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp_port_created(mlxsw_sp, i)) mlxsw_sp 3984 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_remove(mlxsw_sp, i); mlxsw_sp 3985 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_cpu_port_remove(mlxsw_sp); mlxsw_sp 3987 drivers/net/ethernet/mellanox/mlxsw/spectrum.c kfree(mlxsw_sp->port_to_module); mlxsw_sp 3989 drivers/net/ethernet/mellanox/mlxsw/spectrum.c kfree(mlxsw_sp->ports); mlxsw_sp 3990 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports = NULL; mlxsw_sp 4001 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_port_split_create(struct mlxsw_sp *mlxsw_sp, u8 base_port, mlxsw_sp 4008 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_port_create(mlxsw_sp, base_port + i * offset, mlxsw_sp 4018 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp_port_created(mlxsw_sp, base_port + i * offset)) mlxsw_sp 4019 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_remove(mlxsw_sp, base_port + i * offset); mlxsw_sp 4023 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp_port_unsplit_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4036 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->port_to_module[local_port] < 0) mlxsw_sp 4038 drivers/net/ethernet/mellanox/mlxsw/spectrum.c module = mlxsw_sp->port_to_module[local_port]; mlxsw_sp 4040 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_create(mlxsw_sp, local_port, false, module, mlxsw_sp 4046 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_get_by_local_port(struct mlxsw_sp *mlxsw_sp, u8 local_port) mlxsw_sp 4048 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->ports && mlxsw_sp->ports[local_port]) mlxsw_sp 4049 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp->ports[local_port]; mlxsw_sp 4057 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 4071 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port = mlxsw_sp_port_get_by_local_port(mlxsw_sp, local_port); mlxsw_sp 4073 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n", mlxsw_sp 4098 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->ports[base_port + local_ports_in_2x]) { mlxsw_sp 4106 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->ports[base_port + 1] || mlxsw_sp 4107 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ports[base_port + 3]) { mlxsw_sp 4115 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp_port_created(mlxsw_sp, base_port + i * offset)) mlxsw_sp 4116 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_remove(mlxsw_sp, base_port + i * offset); mlxsw_sp 4118 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_port_split_create(mlxsw_sp, base_port, module, count, mlxsw_sp 4121 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to create split ports\n"); mlxsw_sp 4128 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_unsplit_create(mlxsw_sp, base_port, count); mlxsw_sp 4135 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 4149 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port = mlxsw_sp_port_get_by_local_port(mlxsw_sp, local_port); mlxsw_sp 4151 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n", mlxsw_sp 4178 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp_port_created(mlxsw_sp, base_port + i * offset)) mlxsw_sp 4179 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_remove(mlxsw_sp, base_port + i * offset); mlxsw_sp 4181 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port_unsplit_create(mlxsw_sp, base_port, count); mlxsw_sp 4198 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 4204 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 4220 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp1_ptp_fifo_event_func(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4238 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_ptp_got_timestamp(mlxsw_sp, ingress, local_port, mlxsw_sp 4247 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 4249 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_ptp_fifo_event_func(mlxsw_sp, mtpptr_pl, true); mlxsw_sp 4255 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 4257 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp1_ptp_fifo_event_func(mlxsw_sp, mtpptr_pl, false); mlxsw_sp 4263 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 4264 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 4268 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_warn_ratelimited(mlxsw_sp->bus_info->dev, "Port %d: skb received for non-existent port\n", mlxsw_sp 4303 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 4304 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp_port *mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 4309 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_warn_ratelimited(mlxsw_sp->bus_info->dev, "Port %d: sample skb received for non-existent port\n", mlxsw_sp 4314 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_warn_ratelimited(mlxsw_sp->bus_info->dev, "Port %d: sample skb received on unsupported port\n", mlxsw_sp 4338 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 4340 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->receive(mlxsw_sp, skb, local_port); mlxsw_sp 4598 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_traps_register(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4606 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_core_trap_register(mlxsw_sp->core, mlxsw_sp 4608 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp); mlxsw_sp 4617 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_trap_unregister(mlxsw_sp->core, mlxsw_sp 4619 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp); mlxsw_sp 4624 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp_traps_unregister(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4631 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_trap_unregister(mlxsw_sp->core, mlxsw_sp 4633 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp); mlxsw_sp 4637 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_traps_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 4641 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_cpu_policers_set(mlxsw_sp->core); mlxsw_sp 4645 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_trap_groups_set(mlxsw_sp->core); mlxsw_sp 4649 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_traps_register(mlxsw_sp, mlxsw_sp_listener, mlxsw_sp 4654 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_traps_register(mlxsw_sp, mlxsw_sp->listeners, mlxsw_sp 4655 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->listeners_count); mlxsw_sp 4662 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_traps_unregister(mlxsw_sp, mlxsw_sp_listener, mlxsw_sp 4667 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp_traps_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 4669 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_traps_unregister(mlxsw_sp, mlxsw_sp->listeners, mlxsw_sp 4670 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->listeners_count); mlxsw_sp 4671 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_traps_unregister(mlxsw_sp, mlxsw_sp_listener, mlxsw_sp 4677 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_lag_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 4683 drivers/net/ethernet/mellanox/mlxsw/spectrum.c seed = jhash(mlxsw_sp->base_mac, sizeof(mlxsw_sp->base_mac), mlxsw_sp 4694 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcr), slcr_pl); mlxsw_sp 4698 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_LAG) || mlxsw_sp 4699 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_LAG_MEMBERS)) mlxsw_sp 4702 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->lags = kcalloc(MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_LAG), mlxsw_sp 4705 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!mlxsw_sp->lags) mlxsw_sp 4711 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static void mlxsw_sp_lag_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 4713 drivers/net/ethernet/mellanox/mlxsw/spectrum.c kfree(mlxsw_sp->lags); mlxsw_sp 4765 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 4768 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->core = mlxsw_core; mlxsw_sp 4769 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->bus_info = mlxsw_bus_info; mlxsw_sp 4771 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_fw_rev_validate(mlxsw_sp); mlxsw_sp 4775 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_base_mac_get(mlxsw_sp); mlxsw_sp 4777 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to get base mac\n"); mlxsw_sp 4781 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_kvdl_init(mlxsw_sp); mlxsw_sp 4783 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize KVDL\n"); mlxsw_sp 4787 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_fids_init(mlxsw_sp); mlxsw_sp 4789 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize FIDs\n"); mlxsw_sp 4793 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_traps_init(mlxsw_sp); mlxsw_sp 4795 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to set traps\n"); mlxsw_sp 4799 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_devlink_traps_init(mlxsw_sp); mlxsw_sp 4801 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize devlink traps\n"); mlxsw_sp 4805 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_buffers_init(mlxsw_sp); mlxsw_sp 4807 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize buffers\n"); mlxsw_sp 4811 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_lag_init(mlxsw_sp); mlxsw_sp 4813 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize LAG\n"); mlxsw_sp 4820 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_span_init(mlxsw_sp); mlxsw_sp 4822 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to init span system\n"); mlxsw_sp 4826 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_switchdev_init(mlxsw_sp); mlxsw_sp 4828 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize switchdev\n"); mlxsw_sp 4832 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_counter_pool_init(mlxsw_sp); mlxsw_sp 4834 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to init counter pool\n"); mlxsw_sp 4838 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_afa_init(mlxsw_sp); mlxsw_sp 4840 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize ACL actions\n"); mlxsw_sp 4844 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_nve_init(mlxsw_sp); mlxsw_sp 4846 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize NVE\n"); mlxsw_sp 4850 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_acl_init(mlxsw_sp); mlxsw_sp 4852 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize ACL\n"); mlxsw_sp 4856 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_router_init(mlxsw_sp); mlxsw_sp 4858 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize router\n"); mlxsw_sp 4862 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->bus_info->read_frc_capable) { mlxsw_sp 4864 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->clock = mlxsw_sp 4865 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->clock_init(mlxsw_sp, mlxsw_sp 4866 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->bus_info->dev); mlxsw_sp 4867 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (IS_ERR(mlxsw_sp->clock)) { mlxsw_sp 4868 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = PTR_ERR(mlxsw_sp->clock); mlxsw_sp 4869 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to init ptp clock\n"); mlxsw_sp 4874 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->clock) { mlxsw_sp 4876 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_state = mlxsw_sp->ptp_ops->init(mlxsw_sp); mlxsw_sp 4877 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (IS_ERR(mlxsw_sp->ptp_state)) { mlxsw_sp 4878 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = PTR_ERR(mlxsw_sp->ptp_state); mlxsw_sp 4879 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to initialize PTP\n"); mlxsw_sp 4888 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->netdevice_nb.notifier_call = mlxsw_sp_netdevice_event; mlxsw_sp 4889 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = register_netdevice_notifier(&mlxsw_sp->netdevice_nb); mlxsw_sp 4891 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to register netdev notifier\n"); mlxsw_sp 4895 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_dpipe_init(mlxsw_sp); mlxsw_sp 4897 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to init pipeline debug\n"); mlxsw_sp 4901 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_ports_create(mlxsw_sp); mlxsw_sp 4903 drivers/net/ethernet/mellanox/mlxsw/spectrum.c dev_err(mlxsw_sp->bus_info->dev, "Failed to create ports\n"); mlxsw_sp 4910 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_dpipe_fini(mlxsw_sp); mlxsw_sp 4912 drivers/net/ethernet/mellanox/mlxsw/spectrum.c unregister_netdevice_notifier(&mlxsw_sp->netdevice_nb); mlxsw_sp 4914 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->clock) mlxsw_sp 4915 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->fini(mlxsw_sp->ptp_state); mlxsw_sp 4917 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->clock) mlxsw_sp 4918 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->clock_fini(mlxsw_sp->clock); mlxsw_sp 4920 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_router_fini(mlxsw_sp); mlxsw_sp 4922 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_acl_fini(mlxsw_sp); mlxsw_sp 4924 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_nve_fini(mlxsw_sp); mlxsw_sp 4926 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_afa_fini(mlxsw_sp); mlxsw_sp 4928 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_counter_pool_fini(mlxsw_sp); mlxsw_sp 4930 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_switchdev_fini(mlxsw_sp); mlxsw_sp 4932 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_span_fini(mlxsw_sp); mlxsw_sp 4934 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_lag_fini(mlxsw_sp); mlxsw_sp 4936 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_buffers_fini(mlxsw_sp); mlxsw_sp 4938 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_devlink_traps_fini(mlxsw_sp); mlxsw_sp 4940 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_traps_fini(mlxsw_sp); mlxsw_sp 4942 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_fids_fini(mlxsw_sp); mlxsw_sp 4944 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_kvdl_fini(mlxsw_sp); mlxsw_sp 4951 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 4953 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->req_rev = &mlxsw_sp1_fw_rev; mlxsw_sp 4954 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->fw_filename = MLXSW_SP1_FW_FILENAME; mlxsw_sp 4955 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->kvdl_ops = &mlxsw_sp1_kvdl_ops; mlxsw_sp 4956 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->afa_ops = &mlxsw_sp1_act_afa_ops; mlxsw_sp 4957 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->afk_ops = &mlxsw_sp1_afk_ops; mlxsw_sp 4958 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->mr_tcam_ops = &mlxsw_sp1_mr_tcam_ops; mlxsw_sp 4959 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->acl_tcam_ops = &mlxsw_sp1_acl_tcam_ops; mlxsw_sp 4960 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->nve_ops_arr = mlxsw_sp1_nve_ops_arr; mlxsw_sp 4961 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->mac_mask = mlxsw_sp1_mac_mask; mlxsw_sp 4962 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->rif_ops_arr = mlxsw_sp1_rif_ops_arr; mlxsw_sp 4963 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->sb_vals = &mlxsw_sp1_sb_vals; mlxsw_sp 4964 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->port_type_speed_ops = &mlxsw_sp1_port_type_speed_ops; mlxsw_sp 4965 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops = &mlxsw_sp1_ptp_ops; mlxsw_sp 4966 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->listeners = mlxsw_sp1_listener; mlxsw_sp 4967 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->listeners_count = ARRAY_SIZE(mlxsw_sp1_listener); mlxsw_sp 4975 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 4977 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->kvdl_ops = &mlxsw_sp2_kvdl_ops; mlxsw_sp 4978 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->afa_ops = &mlxsw_sp2_act_afa_ops; mlxsw_sp 4979 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->afk_ops = &mlxsw_sp2_afk_ops; mlxsw_sp 4980 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->mr_tcam_ops = &mlxsw_sp2_mr_tcam_ops; mlxsw_sp 4981 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops; mlxsw_sp 4982 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->nve_ops_arr = mlxsw_sp2_nve_ops_arr; mlxsw_sp 4983 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->mac_mask = mlxsw_sp2_mac_mask; mlxsw_sp 4984 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr; mlxsw_sp 4985 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->sb_vals = &mlxsw_sp2_sb_vals; mlxsw_sp 4986 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops; mlxsw_sp 4987 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops; mlxsw_sp 4994 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 4996 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_ports_remove(mlxsw_sp); mlxsw_sp 4997 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_dpipe_fini(mlxsw_sp); mlxsw_sp 4998 drivers/net/ethernet/mellanox/mlxsw/spectrum.c unregister_netdevice_notifier(&mlxsw_sp->netdevice_nb); mlxsw_sp 4999 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp->clock) { mlxsw_sp 5000 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->fini(mlxsw_sp->ptp_state); mlxsw_sp 5001 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->clock_fini(mlxsw_sp->clock); mlxsw_sp 5003 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_router_fini(mlxsw_sp); mlxsw_sp 5004 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_acl_fini(mlxsw_sp); mlxsw_sp 5005 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_nve_fini(mlxsw_sp); mlxsw_sp 5006 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_afa_fini(mlxsw_sp); mlxsw_sp 5007 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_counter_pool_fini(mlxsw_sp); mlxsw_sp 5008 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_switchdev_fini(mlxsw_sp); mlxsw_sp 5009 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_span_fini(mlxsw_sp); mlxsw_sp 5010 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_lag_fini(mlxsw_sp); mlxsw_sp 5011 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_buffers_fini(mlxsw_sp); mlxsw_sp 5012 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_devlink_traps_fini(mlxsw_sp); mlxsw_sp 5013 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_traps_fini(mlxsw_sp); mlxsw_sp 5014 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_fids_fini(mlxsw_sp); mlxsw_sp 5015 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_kvdl_fini(mlxsw_sp); mlxsw_sp 5306 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 5308 drivers/net/ethernet/mellanox/mlxsw/spectrum.c ctx->val.vu32 = mlxsw_sp_acl_region_rehash_intrvl_get(mlxsw_sp); mlxsw_sp 5317 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 5319 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_acl_region_rehash_intrvl_set(mlxsw_sp, ctx->val.vu32); mlxsw_sp 5369 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 5372 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp->ptp_ops->transmitted(mlxsw_sp, skb, local_port); mlxsw_sp 5377 drivers/net/ethernet/mellanox/mlxsw/spectrum.c .priv_size = sizeof(struct mlxsw_sp), mlxsw_sp 5411 drivers/net/ethernet/mellanox/mlxsw/spectrum.c .priv_size = sizeof(struct mlxsw_sp), mlxsw_sp 5444 drivers/net/ethernet/mellanox/mlxsw/spectrum.c .priv_size = sizeof(struct mlxsw_sp), mlxsw_sp 5506 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev) mlxsw_sp 5511 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_port ? mlxsw_sp_port->mlxsw_sp : NULL; mlxsw_sp 5564 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_lag_create(struct mlxsw_sp *mlxsw_sp, u16 lag_id) mlxsw_sp 5569 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); mlxsw_sp 5572 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_lag_destroy(struct mlxsw_sp *mlxsw_sp, u16 lag_id) mlxsw_sp 5577 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); mlxsw_sp 5583 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5588 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); mlxsw_sp 5594 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5599 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); mlxsw_sp 5605 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5610 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); mlxsw_sp 5616 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5621 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(slcor), slcor_pl); mlxsw_sp 5624 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_lag_index_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5633 drivers/net/ethernet/mellanox/mlxsw/spectrum.c max_lag = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_LAG); mlxsw_sp 5635 drivers/net/ethernet/mellanox/mlxsw/spectrum.c lag = mlxsw_sp_lag_get(mlxsw_sp, i); mlxsw_sp 5652 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_master_lag_check(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5659 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp_lag_index_get(mlxsw_sp, lag_dev, &lag_id) != 0) { mlxsw_sp 5670 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_port_lag_index_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5676 drivers/net/ethernet/mellanox/mlxsw/spectrum.c max_lag_members = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 5679 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!mlxsw_sp_port_lagged_get(mlxsw_sp, lag_id, i)) { mlxsw_sp 5690 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5696 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_lag_index_get(mlxsw_sp, lag_dev, &lag_id); mlxsw_sp 5699 drivers/net/ethernet/mellanox/mlxsw/spectrum.c lag = mlxsw_sp_lag_get(mlxsw_sp, lag_id); mlxsw_sp 5701 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_lag_create(mlxsw_sp, lag_id); mlxsw_sp 5707 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_port_lag_index_get(mlxsw_sp, lag_id, &port_index); mlxsw_sp 5714 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_lag_mapping_set(mlxsw_sp->core, lag_id, port_index, mlxsw_sp 5728 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_lag_destroy(mlxsw_sp, lag_id); mlxsw_sp 5735 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5741 drivers/net/ethernet/mellanox/mlxsw/spectrum.c lag = mlxsw_sp_lag_get(mlxsw_sp, lag_id); mlxsw_sp 5755 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_lag_destroy(mlxsw_sp, lag_id); mlxsw_sp 5757 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_core_lag_mapping_clear(mlxsw_sp->core, lag_id, mlxsw_sp 5769 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5774 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); mlxsw_sp 5780 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5785 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sldr), sldr_pl); mlxsw_sp 5843 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 5860 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(spms), spms_pl); mlxsw_sp 5983 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 5987 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 6005 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp, upper_dev) && mlxsw_sp 6011 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp, mlxsw_sp 6017 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_master_lag_check(mlxsw_sp, upper_dev, mlxsw_sp 6030 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_rif_find_by_dev(mlxsw_sp, lower_dev)) { mlxsw_sp 6071 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); mlxsw_sp 6155 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 6174 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp, upper_dev) && mlxsw_sp 6180 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp, mlxsw_sp 6186 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_rif_find_by_dev(mlxsw_sp, vlan_dev)) { mlxsw_sp 6205 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); mlxsw_sp 6243 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(vlan_dev); mlxsw_sp 6248 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!mlxsw_sp) mlxsw_sp 6263 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_rif_find_by_dev(mlxsw_sp, vlan_dev)) { mlxsw_sp 6273 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); mlxsw_sp 6303 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(br_dev); mlxsw_sp 6308 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!mlxsw_sp) mlxsw_sp 6323 drivers/net/ethernet/mellanox/mlxsw/spectrum.c !mlxsw_sp_rif_find_by_dev(mlxsw_sp, br_dev)) { mlxsw_sp 6333 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_rif_destroy_by_dev(mlxsw_sp, upper_dev); mlxsw_sp 6335 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_rif_macvlan_del(mlxsw_sp, upper_dev); mlxsw_sp 6345 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(macvlan_dev); mlxsw_sp 6349 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (!mlxsw_sp || event != NETDEV_PRECHANGEUPPER) mlxsw_sp 6369 drivers/net/ethernet/mellanox/mlxsw/spectrum.c static int mlxsw_sp_netdevice_vxlan_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6401 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_bridge_vxlan_join(mlxsw_sp, upper_dev, mlxsw_sp 6409 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_bridge_vxlan_leave(mlxsw_sp, dev); mlxsw_sp 6420 drivers/net/ethernet/mellanox/mlxsw/spectrum.c return mlxsw_sp_bridge_vxlan_join(mlxsw_sp, upper_dev, dev, 0, mlxsw_sp 6430 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_bridge_vxlan_leave(mlxsw_sp, dev); mlxsw_sp 6442 drivers/net/ethernet/mellanox/mlxsw/spectrum.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 6445 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp = container_of(nb, struct mlxsw_sp, netdevice_nb); mlxsw_sp 6447 drivers/net/ethernet/mellanox/mlxsw/spectrum.c span_entry = mlxsw_sp_span_entry_find_by_port(mlxsw_sp, dev); mlxsw_sp 6449 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_span_entry_invalidate(mlxsw_sp, span_entry); mlxsw_sp 6451 drivers/net/ethernet/mellanox/mlxsw/spectrum.c mlxsw_sp_span_respin(mlxsw_sp); mlxsw_sp 6454 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_netdevice_vxlan_event(mlxsw_sp, dev, event, ptr); mlxsw_sp 6455 drivers/net/ethernet/mellanox/mlxsw/spectrum.c if (mlxsw_sp_netdev_is_ipip_ol(mlxsw_sp, dev)) mlxsw_sp 6456 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_netdevice_ipip_ol_event(mlxsw_sp, dev, mlxsw_sp 6458 drivers/net/ethernet/mellanox/mlxsw/spectrum.c else if (mlxsw_sp_netdev_is_ipip_ul(mlxsw_sp, dev)) mlxsw_sp 6459 drivers/net/ethernet/mellanox/mlxsw/spectrum.c err = mlxsw_sp_netdevice_ipip_ul_event(mlxsw_sp, dev, mlxsw_sp 185 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_lag_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id) mlxsw_sp 187 drivers/net/ethernet/mellanox/mlxsw/spectrum.h return &mlxsw_sp->lags[lag_id]; mlxsw_sp 241 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp *mlxsw_sp; mlxsw_sp 289 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*from_ptys_supported_port)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 292 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*from_ptys_link)(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto, mlxsw_sp 294 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 (*from_ptys_speed)(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto); mlxsw_sp 295 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*from_ptys_speed_duplex)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 298 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 (*to_ptys_advert_link)(struct mlxsw_sp *mlxsw_sp, u8 width, mlxsw_sp 300 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 (*to_ptys_speed)(struct mlxsw_sp *mlxsw_sp, u8 width, u32 speed); mlxsw_sp 301 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 (*to_ptys_upper_speed)(struct mlxsw_sp *mlxsw_sp, u32 upper_speed); mlxsw_sp 302 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*port_speed_base)(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 304 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*reg_ptys_eth_pack)(struct mlxsw_sp *mlxsw_sp, char *payload, mlxsw_sp 306 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*reg_ptys_eth_unpack)(struct mlxsw_sp *mlxsw_sp, char *payload, mlxsw_sp 358 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_port_lagged_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id, u8 port_index) mlxsw_sp 363 drivers/net/ethernet/mellanox/mlxsw/spectrum.h local_port = mlxsw_core_lag_mapping_get(mlxsw_sp->core, mlxsw_sp 365 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 391 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 392 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_buffers_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 427 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 mlxsw_sp_cells_bytes(const struct mlxsw_sp *mlxsw_sp, u32 cells); mlxsw_sp 428 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 mlxsw_sp_bytes_cells(const struct mlxsw_sp *mlxsw_sp, u32 bytes); mlxsw_sp 429 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 mlxsw_sp_sb_max_headroom_cells(const struct mlxsw_sp *mlxsw_sp); mlxsw_sp 435 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 436 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 437 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, mlxsw_sp 448 drivers/net/ethernet/mellanox/mlxsw/spectrum.h bool mlxsw_sp_bridge_device_is_offloaded(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 450 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 454 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 456 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_bridge_fid_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 488 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_flow_counter_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 491 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_flow_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 493 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_flow_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 496 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev); mlxsw_sp 527 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 528 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 531 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_rif_macvlan_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 539 drivers/net/ethernet/mellanox/mlxsw/spectrum.h bool mlxsw_sp_netdev_is_ipip_ol(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 541 drivers/net/ethernet/mellanox/mlxsw/spectrum.h bool mlxsw_sp_netdev_is_ipip_ul(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 543 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_netdevice_ipip_ol_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 548 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_netdevice_ipip_ul_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 554 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_rif_destroy_by_dev(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 556 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_rif *mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 558 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u8 mlxsw_sp_router_port(const struct mlxsw_sp *mlxsw_sp); mlxsw_sp 560 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_router_nve_promote_decap(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id, mlxsw_sp 564 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_router_nve_demote_decap(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id, mlxsw_sp 567 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_router_tb_id_vr_id(struct mlxsw_sp *mlxsw_sp, u32 tb_id, mlxsw_sp 569 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_router_ul_rif_get(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id, mlxsw_sp 571 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_router_ul_rif_put(struct mlxsw_sp *mlxsw_sp, u16 ul_rif_index); mlxsw_sp 598 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv); mlxsw_sp 599 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv); mlxsw_sp 600 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*alloc)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 603 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*free)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 606 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*alloc_size_query)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 610 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*resources_register)(struct mlxsw_sp *mlxsw_sp, void *priv); mlxsw_sp 613 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_kvdl_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 614 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_kvdl_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 615 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 618 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 621 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_kvdl_alloc_count_query(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 654 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp *mlxsw_sp; mlxsw_sp 662 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block); mlxsw_sp 667 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_acl_block *mlxsw_sp_acl_block_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 670 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_block_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 675 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_block_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 681 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 685 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_acl_ruleset_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 689 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_acl_ruleset_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 713 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rulei_act_mirror(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 718 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 722 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rulei_act_vlan(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 726 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rulei_act_count(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 729 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rulei_act_fid_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 736 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 741 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_acl_rule_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 743 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rule_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 745 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 747 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rule_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 751 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 756 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_rule_get_stats(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 760 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 762 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 763 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_acl_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 764 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 mlxsw_sp_acl_region_rehash_intrvl_get(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 765 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_acl_region_rehash_intrvl_set(struct mlxsw_sp *mlxsw_sp, u32 val); mlxsw_sp 774 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 776 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv); mlxsw_sp 778 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*region_init)(struct mlxsw_sp *mlxsw_sp, void *region_priv, mlxsw_sp 782 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*region_fini)(struct mlxsw_sp *mlxsw_sp, void *region_priv); mlxsw_sp 783 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*region_associate)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 792 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*entry_add)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 796 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*entry_del)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 799 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*entry_action_replace)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 802 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*entry_activity_get)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 822 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_flower_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 825 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_flower_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 828 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_flower_stats(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 831 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_flower_tmplt_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 834 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_flower_tmplt_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 847 drivers/net/ethernet/mellanox/mlxsw/spectrum.h bool mlxsw_sp_fid_is_dummy(struct mlxsw_sp *mlxsw_sp, u16 fid_index); mlxsw_sp 849 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_index(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 854 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_vni(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 879 drivers/net/ethernet/mellanox/mlxsw/spectrum.h mlxsw_sp_fid_type_rif_type(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 882 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_8021q_get(struct mlxsw_sp *mlxsw_sp, u16 vid); mlxsw_sp 883 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_8021d_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 885 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_8021q_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 887 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_8021d_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 889 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_rfid_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 891 drivers/net/ethernet/mellanox/mlxsw/spectrum.h struct mlxsw_sp_fid *mlxsw_sp_fid_dummy_get(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 895 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_fids_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 896 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_fids_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 912 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv); mlxsw_sp 915 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*route_create)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 920 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void (*route_destroy)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 923 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int (*route_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 944 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_nve_learned_ip_resolve(struct mlxsw_sp *mlxsw_sp, u32 uip, mlxsw_sp 947 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_nve_flood_ip_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 951 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_nve_flood_ip_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 955 drivers/net/ethernet/mellanox/mlxsw/spectrum.h u32 mlxsw_sp_nve_decap_tunnel_index_get(const struct mlxsw_sp *mlxsw_sp); mlxsw_sp 956 drivers/net/ethernet/mellanox/mlxsw/spectrum.h bool mlxsw_sp_nve_ipv4_route_is_decap(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 958 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_nve_fid_enable(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *fid, mlxsw_sp 961 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_nve_fid_disable(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 965 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 966 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_nve_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 969 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_nve_inc_parsing_depth_get(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 970 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_nve_inc_parsing_depth_put(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 973 drivers/net/ethernet/mellanox/mlxsw/spectrum.h int mlxsw_sp_devlink_traps_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 974 drivers/net/ethernet/mellanox/mlxsw/spectrum.h void mlxsw_sp_devlink_traps_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 50 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c static int mlxsw_sp1_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 56 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c static void mlxsw_sp1_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 61 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_ctcam_region_catchall_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 70 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, NULL); mlxsw_sp 81 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c err = mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, ®ion->cregion, mlxsw_sp 100 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_ctcam_region_catchall_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 105 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, ®ion->cregion, mlxsw_sp 113 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_tcam_region_init(struct mlxsw_sp *mlxsw_sp, void *region_priv, mlxsw_sp 121 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c err = mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, ®ion->cregion, mlxsw_sp 126 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c err = mlxsw_sp1_acl_ctcam_region_catchall_add(mlxsw_sp, region); mlxsw_sp 138 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_tcam_region_fini(struct mlxsw_sp *mlxsw_sp, void *region_priv) mlxsw_sp 142 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_ctcam_region_catchall_del(mlxsw_sp, region); mlxsw_sp 147 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_tcam_region_associate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 170 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c static int mlxsw_sp1_acl_tcam_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 179 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c return mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, ®ion->cregion, mlxsw_sp 184 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c static void mlxsw_sp1_acl_tcam_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 192 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, ®ion->cregion, mlxsw_sp 197 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_tcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 205 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_tcam_region_entry_activity_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 215 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); mlxsw_sp 223 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c mlxsw_sp1_acl_tcam_entry_activity_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 232 drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c return mlxsw_sp1_acl_tcam_region_entry_activity_get(mlxsw_sp, mlxsw_sp 146 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c static int mlxsw_sp1_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 164 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c static void mlxsw_sp1_kvdl_free(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 177 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c static int mlxsw_sp1_kvdl_alloc_size_query(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 208 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c mlxsw_sp1_kvdl_part_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 212 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 245 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c static int mlxsw_sp1_kvdl_parts_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 254 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c kvdl->parts[i] = mlxsw_sp1_kvdl_part_init(mlxsw_sp, info, mlxsw_sp 333 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c static int mlxsw_sp1_kvdl_init(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 335 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 339 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c err = mlxsw_sp1_kvdl_parts_init(mlxsw_sp, kvdl); mlxsw_sp 361 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c static void mlxsw_sp1_kvdl_fini(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 363 drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 13 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 28 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c static int mlxsw_sp1_mr_tcam_route_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 57 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rmft2), rmft2_pl); mlxsw_sp 60 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c static int mlxsw_sp1_mr_tcam_route_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 79 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rmft2), rmft2_pl); mlxsw_sp 122 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mlxsw_sp1_mr_tcam_route_create(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 137 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c err = mlxsw_sp1_mr_tcam_route_replace(mlxsw_sp, &route->parman_item, mlxsw_sp 149 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mlxsw_sp1_mr_tcam_route_destroy(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 156 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mlxsw_sp1_mr_tcam_route_remove(mlxsw_sp, &route->parman_item, key); mlxsw_sp 161 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mlxsw_sp1_mr_tcam_route_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 168 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c return mlxsw_sp1_mr_tcam_route_replace(mlxsw_sp, &route->parman_item, mlxsw_sp 178 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c struct mlxsw_sp *mlxsw_sp = mr_tcam_region->mlxsw_sp; mlxsw_sp 184 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rtar), rtar_pl); mlxsw_sp 190 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c struct mlxsw_sp *mlxsw_sp = mr_tcam_region->mlxsw_sp; mlxsw_sp 195 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rtar), rtar_pl); mlxsw_sp 202 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c struct mlxsw_sp *mlxsw_sp = mr_tcam_region->mlxsw_sp; mlxsw_sp 206 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c max_tcam_rules = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_TCAM_RULES); mlxsw_sp 211 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rtar), rtar_pl); mlxsw_sp 220 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c struct mlxsw_sp *mlxsw_sp = mr_tcam_region->mlxsw_sp; mlxsw_sp 226 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rrcr), rrcr_pl); mlxsw_sp 238 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mlxsw_sp1_mr_tcam_region_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 248 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c mr_tcam_region->mlxsw_sp = mlxsw_sp; mlxsw_sp 294 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c static int mlxsw_sp1_mr_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 301 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_MAX_TCAM_RULES)) mlxsw_sp 305 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c err = mlxsw_sp1_mr_tcam_region_init(mlxsw_sp, mlxsw_sp 312 drivers/net/ethernet/mellanox/mlxsw/spectrum1_mr_tcam.c err = mlxsw_sp1_mr_tcam_region_init(mlxsw_sp, mlxsw_sp 69 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c static int mlxsw_sp2_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 81 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, mlxsw_sp 90 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c afa_block = mlxsw_afa_block_create(mlxsw_sp->afa); mlxsw_sp 103 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pefa), pefa_pl); mlxsw_sp 108 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pgcr), pgcr_pl); mlxsw_sp 112 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c err = mlxsw_sp_acl_atcam_init(mlxsw_sp, &tcam->atcam); mlxsw_sp 125 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, mlxsw_sp 130 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c static void mlxsw_sp2_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 134 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp_acl_atcam_fini(mlxsw_sp, &tcam->atcam); mlxsw_sp 135 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, mlxsw_sp 140 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp2_acl_tcam_region_init(struct mlxsw_sp *mlxsw_sp, void *region_priv, mlxsw_sp 150 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c return mlxsw_sp_acl_atcam_region_init(mlxsw_sp, &tcam->atcam, mlxsw_sp 157 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp2_acl_tcam_region_fini(struct mlxsw_sp *mlxsw_sp, void *region_priv) mlxsw_sp 165 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp2_acl_tcam_region_associate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 168 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c return mlxsw_sp_acl_atcam_region_associate(mlxsw_sp, region->id); mlxsw_sp 200 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c static int mlxsw_sp2_acl_tcam_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 210 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c return mlxsw_sp_acl_atcam_entry_add(mlxsw_sp, ®ion->aregion, mlxsw_sp 215 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c static void mlxsw_sp2_acl_tcam_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 223 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp_acl_atcam_entry_del(mlxsw_sp, ®ion->aregion, &chunk->achunk, mlxsw_sp 228 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp2_acl_tcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 236 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c return mlxsw_sp_acl_atcam_entry_action_replace(mlxsw_sp, mlxsw_sp 242 drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c mlxsw_sp2_acl_tcam_entry_activity_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 106 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static int mlxsw_sp2_kvdl_rec_del(struct mlxsw_sp *mlxsw_sp, u8 res_type, mlxsw_sp 118 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(iedr), iedr_pl); mlxsw_sp 123 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static void mlxsw_sp2_kvdl_part_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 133 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c err = mlxsw_sp2_kvdl_rec_del(mlxsw_sp, part->info->res_type, mlxsw_sp 144 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static int mlxsw_sp2_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 156 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static void mlxsw_sp2_kvdl_free(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 165 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c return mlxsw_sp2_kvdl_part_free(mlxsw_sp, part, size, entry_index); mlxsw_sp 168 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static int mlxsw_sp2_kvdl_alloc_size_query(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 179 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c mlxsw_sp2_kvdl_part_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 188 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c if (!mlxsw_core_res_valid(mlxsw_sp->core, mlxsw_sp 190 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c !mlxsw_core_res_valid(mlxsw_sp->core, mlxsw_sp 193 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c usage_bit_count = mlxsw_core_res_get(mlxsw_sp->core, mlxsw_sp 195 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c index_range = mlxsw_core_res_get(mlxsw_sp->core, mlxsw_sp 220 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static int mlxsw_sp2_kvdl_parts_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 229 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c kvdl->parts[i] = mlxsw_sp2_kvdl_part_init(mlxsw_sp, info); mlxsw_sp 251 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static int mlxsw_sp2_kvdl_init(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 255 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c return mlxsw_sp2_kvdl_parts_init(mlxsw_sp, kvdl); mlxsw_sp 258 drivers/net/ethernet/mellanox/mlxsw/spectrum2_kvdl.c static void mlxsw_sp2_kvdl_fini(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 11 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 34 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c static int mlxsw_sp2_mr_tcam_bind_group(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 44 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pemrbt), pemrbt_pl); mlxsw_sp 63 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mr_tcam->ruleset4 = mlxsw_sp_acl_ruleset_get(mr_tcam->mlxsw_sp, mlxsw_sp 73 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c err = mlxsw_sp2_mr_tcam_bind_group(mr_tcam->mlxsw_sp, mlxsw_sp 82 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp_acl_ruleset_put(mr_tcam->mlxsw_sp, mr_tcam->ruleset4); mlxsw_sp 88 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp_acl_ruleset_put(mr_tcam->mlxsw_sp, mr_tcam->ruleset4); mlxsw_sp 113 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mr_tcam->ruleset6 = mlxsw_sp_acl_ruleset_get(mr_tcam->mlxsw_sp, mlxsw_sp 123 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c err = mlxsw_sp2_mr_tcam_bind_group(mr_tcam->mlxsw_sp, mlxsw_sp 132 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp_acl_ruleset_put(mr_tcam->mlxsw_sp, mr_tcam->ruleset6); mlxsw_sp 138 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp_acl_ruleset_put(mr_tcam->mlxsw_sp, mr_tcam->ruleset6); mlxsw_sp 206 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp2_mr_tcam_route_create(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 223 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c rule = mlxsw_sp_acl_rule_create(mlxsw_sp, ruleset, mlxsw_sp 230 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c err = mlxsw_sp_acl_rule_add(mlxsw_sp, rule); mlxsw_sp 237 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule); mlxsw_sp 242 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp2_mr_tcam_route_destroy(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 254 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, mlxsw_sp 259 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp_acl_rule_del(mlxsw_sp, rule); mlxsw_sp 260 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule); mlxsw_sp 264 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mlxsw_sp2_mr_tcam_route_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 278 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, mlxsw_sp 283 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c return mlxsw_sp_acl_rule_action_replace(mlxsw_sp, rule, afa_block); mlxsw_sp 286 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c static int mlxsw_sp2_mr_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 291 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mr_tcam->mlxsw_sp = mlxsw_sp; mlxsw_sp 292 drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c mr_tcam->acl_block = mlxsw_sp_acl_block_create(mlxsw_sp, NULL); mlxsw_sp 24 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 92 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 94 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c return mlxsw_sp->acl->dummy_fid; mlxsw_sp 97 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block) mlxsw_sp 99 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c return block->mlxsw_sp; mlxsw_sp 143 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 150 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c return ops->ruleset_bind(mlxsw_sp, ruleset->priv, mlxsw_sp 155 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 162 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c ops->ruleset_unbind(mlxsw_sp, ruleset->priv, mlxsw_sp 172 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_block_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 181 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = mlxsw_sp_acl_ruleset_bind(mlxsw_sp, block, binding); mlxsw_sp 190 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); mlxsw_sp 197 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_block_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 204 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); mlxsw_sp 208 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl_block *mlxsw_sp_acl_block_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 217 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c block->mlxsw_sp = mlxsw_sp; mlxsw_sp 241 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_block_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 265 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = mlxsw_sp_acl_ruleset_bind(mlxsw_sp, block, binding); mlxsw_sp 278 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_block_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 292 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_unbind(mlxsw_sp, block, binding); mlxsw_sp 299 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 304 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl *acl = mlxsw_sp->acl; mlxsw_sp 322 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = ops->ruleset_add(mlxsw_sp, &acl->tcam, ruleset->priv, mlxsw_sp 335 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c ops->ruleset_del(mlxsw_sp, ruleset->priv); mlxsw_sp 343 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c static void mlxsw_sp_acl_ruleset_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 347 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl *acl = mlxsw_sp->acl; mlxsw_sp 351 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c ops->ruleset_del(mlxsw_sp, ruleset->priv); mlxsw_sp 361 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c static void mlxsw_sp_acl_ruleset_ref_dec(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 366 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_destroy(mlxsw_sp, ruleset); mlxsw_sp 385 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 390 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl *acl = mlxsw_sp->acl; mlxsw_sp 393 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c ops = mlxsw_sp_acl_tcam_profile_ops(mlxsw_sp, profile); mlxsw_sp 403 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 409 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl *acl = mlxsw_sp->acl; mlxsw_sp 412 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c ops = mlxsw_sp_acl_tcam_profile_ops(mlxsw_sp, profile); mlxsw_sp 421 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c return mlxsw_sp_acl_ruleset_create(mlxsw_sp, block, chain_index, ops, mlxsw_sp 425 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c void mlxsw_sp_acl_ruleset_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 428 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); mlxsw_sp 454 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c rulei->act_block = mlxsw_afa_block_create(acl->mlxsw_sp->afa); mlxsw_sp 529 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 544 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c if (mlxsw_sp_port->mlxsw_sp != mlxsw_sp) { mlxsw_sp 561 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rulei_act_mirror(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 585 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rulei_act_vlan(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 602 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c dev_err(mlxsw_sp->bus_info->dev, "Unsupported VLAN protocol %#04x\n", mlxsw_sp 612 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c dev_err(mlxsw_sp->bus_info->dev, "Unsupported VLAN action\n"); mlxsw_sp 617 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rulei_act_count(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 625 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rulei_act_fid_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 633 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 653 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, afa_block); mlxsw_sp 664 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); mlxsw_sp 668 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c void mlxsw_sp_acl_rule_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 675 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_ref_dec(mlxsw_sp, ruleset); mlxsw_sp 678 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rule_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 686 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = ops->rule_add(mlxsw_sp, ruleset->priv, rule->priv, rule->rulei); mlxsw_sp 701 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = mlxsw_sp_acl_ruleset_block_bind(mlxsw_sp, ruleset, block); mlxsw_sp 706 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mutex_lock(&mlxsw_sp->acl->rules_lock); mlxsw_sp 707 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c list_add_tail(&rule->list, &mlxsw_sp->acl->rules); mlxsw_sp 708 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mutex_unlock(&mlxsw_sp->acl->rules_lock); mlxsw_sp 717 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c ops->rule_del(mlxsw_sp, rule->priv); mlxsw_sp 721 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c void mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 730 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mutex_lock(&mlxsw_sp->acl->rules_lock); mlxsw_sp 732 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mutex_unlock(&mlxsw_sp->acl->rules_lock); mlxsw_sp 735 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_ruleset_block_unbind(mlxsw_sp, ruleset, mlxsw_sp 739 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c ops->rule_del(mlxsw_sp, rule->priv); mlxsw_sp 742 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rule_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 753 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c return ops->rule_action_replace(mlxsw_sp, rule->priv, rule->rulei); mlxsw_sp 757 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 771 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c static int mlxsw_sp_acl_rule_activity_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 779 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = ops->rule_activity_get(mlxsw_sp, rule->priv, &active); mlxsw_sp 794 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = mlxsw_sp_acl_rule_activity_update(acl->mlxsw_sp, mlxsw_sp 823 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c dev_err(acl->mlxsw_sp->bus_info->dev, "Could not update acl activity"); mlxsw_sp 828 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_rule_get_stats(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 839 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = mlxsw_sp_flow_counter_get(mlxsw_sp, rulei->counter_index, mlxsw_sp 854 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 861 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c alloc_size = sizeof(*acl) + mlxsw_sp_acl_tcam_priv_size(mlxsw_sp); mlxsw_sp 865 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp->acl = acl; mlxsw_sp 866 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c acl->mlxsw_sp = mlxsw_sp; mlxsw_sp 867 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c acl->afk = mlxsw_afk_create(MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 869 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp->afk_ops); mlxsw_sp 880 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c fid = mlxsw_sp_fid_dummy_get(mlxsw_sp); mlxsw_sp 889 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c err = mlxsw_sp_acl_tcam_init(mlxsw_sp, &acl->tcam); mlxsw_sp 912 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c void mlxsw_sp_acl_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 914 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl *acl = mlxsw_sp->acl; mlxsw_sp 916 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c cancel_delayed_work_sync(&mlxsw_sp->acl->rule_activity_update.dw); mlxsw_sp 917 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c mlxsw_sp_acl_tcam_fini(mlxsw_sp, &acl->tcam); mlxsw_sp 926 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c u32 mlxsw_sp_acl_region_rehash_intrvl_get(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 928 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl *acl = mlxsw_sp->acl; mlxsw_sp 930 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c return mlxsw_sp_acl_tcam_vregion_rehash_intrvl_get(mlxsw_sp, mlxsw_sp 934 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c int mlxsw_sp_acl_region_rehash_intrvl_set(struct mlxsw_sp *mlxsw_sp, u32 val) mlxsw_sp 936 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c struct mlxsw_sp_acl *acl = mlxsw_sp->acl; mlxsw_sp 938 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c return mlxsw_sp_acl_tcam_vregion_rehash_intrvl_set(mlxsw_sp, mlxsw_sp 120 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; mlxsw_sp 126 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_MAX_LARGE_KEY_ID)) mlxsw_sp 129 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c max_lkey_id = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_LARGE_KEY_ID); mlxsw_sp 229 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c struct mlxsw_sp *mlxsw_sp = region->mlxsw_sp; mlxsw_sp 230 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c struct mlxsw_afk *afk = mlxsw_sp_acl_afk(mlxsw_sp->acl); mlxsw_sp 276 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c int mlxsw_sp_acl_atcam_region_associate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 284 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c max_regions = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_REGIONS); mlxsw_sp 289 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(perar), perar_pl); mlxsw_sp 317 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 341 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, &aregion->cregion, mlxsw_sp 380 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_atcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 392 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_sp_acl_tcam_priority_get(mlxsw_sp, rulei, &priority, true); mlxsw_sp 410 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce3), ptce3_pl); mlxsw_sp 422 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_atcam_region_entry_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 439 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce3), ptce3_pl); mlxsw_sp 444 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_atcam_region_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 456 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_sp_acl_tcam_priority_get(mlxsw_sp, rulei, &priority, true); mlxsw_sp 468 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce3), ptce3_pl); mlxsw_sp 472 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c __mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 479 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c struct mlxsw_afk *afk = mlxsw_sp_acl_afk(mlxsw_sp->acl); mlxsw_sp 524 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_sp_acl_erp_bf_insert(mlxsw_sp, aregion, erp_mask, aentry); mlxsw_sp 528 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_sp_acl_atcam_region_entry_insert(mlxsw_sp, aregion, aentry, mlxsw_sp 536 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, erp_mask, aentry); mlxsw_sp 547 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c __mlxsw_sp_acl_atcam_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 551 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_atcam_region_entry_remove(mlxsw_sp, aregion, aentry); mlxsw_sp 552 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, aentry->erp_mask, aentry); mlxsw_sp 560 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c __mlxsw_sp_acl_atcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 565 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c return mlxsw_sp_acl_atcam_region_entry_action_replace(mlxsw_sp, aregion, mlxsw_sp 569 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c int mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 577 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = __mlxsw_sp_acl_atcam_entry_add(mlxsw_sp, aregion, aentry, rulei); mlxsw_sp 584 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c trace_mlxsw_sp_acl_atcam_entry_add_ctcam_spill(mlxsw_sp, aregion); mlxsw_sp 585 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, &aregion->cregion, mlxsw_sp 594 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c void mlxsw_sp_acl_atcam_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 600 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, &aregion->cregion, mlxsw_sp 603 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c __mlxsw_sp_acl_atcam_entry_del(mlxsw_sp, aregion, aentry); mlxsw_sp 607 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_atcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 615 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = mlxsw_sp_acl_ctcam_entry_action_replace(mlxsw_sp, mlxsw_sp 620 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c err = __mlxsw_sp_acl_atcam_entry_action_replace(mlxsw_sp, mlxsw_sp 627 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c int mlxsw_sp_acl_atcam_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 630 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c return mlxsw_sp_acl_erps_init(mlxsw_sp, atcam); mlxsw_sp 633 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c void mlxsw_sp_acl_atcam_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 636 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c mlxsw_sp_acl_erps_fini(mlxsw_sp, atcam); mlxsw_sp 166 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c mlxsw_sp_acl_bf_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 196 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(peabfe), peabfe_pl); mlxsw_sp 210 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c mlxsw_sp_acl_bf_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 233 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(peabfe), peabfe_pl); mlxsw_sp 242 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c mlxsw_sp_acl_bf_init(struct mlxsw_sp *mlxsw_sp, unsigned int num_erp_banks) mlxsw_sp 247 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_MAX_BF_LOG)) mlxsw_sp 253 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c bf_bank_size = 1 << MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_BF_LOG); mlxsw_sp 14 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_resize(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 23 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptar), ptar_pl); mlxsw_sp 27 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_move(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 36 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(prcr), prcr_pl); mlxsw_sp 40 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 47 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c struct mlxsw_afk *afk = mlxsw_sp_acl_afk(mlxsw_sp->acl); mlxsw_sp 55 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c err = mlxsw_sp_acl_tcam_priority_get(mlxsw_sp, rulei, &priority, mlxsw_sp 75 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); mlxsw_sp 87 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_entry_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 96 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); mlxsw_sp 101 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 117 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); mlxsw_sp 126 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c struct mlxsw_sp *mlxsw_sp = region->mlxsw_sp; mlxsw_sp 129 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c max_tcam_rules = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_TCAM_RULES); mlxsw_sp 132 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c return mlxsw_sp_acl_ctcam_region_resize(mlxsw_sp, region, new_count); mlxsw_sp 142 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c struct mlxsw_sp *mlxsw_sp = region->mlxsw_sp; mlxsw_sp 144 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_move(mlxsw_sp, region, mlxsw_sp 157 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 188 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c int mlxsw_sp_acl_ctcam_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 202 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c err = mlxsw_sp_acl_ctcam_region_entry_insert(mlxsw_sp, cregion, centry, mlxsw_sp 214 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c void mlxsw_sp_acl_ctcam_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 219 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c mlxsw_sp_acl_ctcam_region_entry_remove(mlxsw_sp, cregion, centry); mlxsw_sp 224 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c int mlxsw_sp_acl_ctcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 229 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c return mlxsw_sp_acl_ctcam_region_entry_action_replace(mlxsw_sp, cregion, mlxsw_sp 27 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 184 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = region->mlxsw_sp; mlxsw_sp 193 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(percr), percr_pl); mlxsw_sp 386 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = erp_table->erp_core->mlxsw_sp; mlxsw_sp 399 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(perpt), perpt_pl); mlxsw_sp 406 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = erp_table->erp_core->mlxsw_sp; mlxsw_sp 418 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(perpt), perpt_pl); mlxsw_sp 426 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = erp_table->erp_core->mlxsw_sp; mlxsw_sp 434 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pererp), pererp_pl); mlxsw_sp 441 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = erp_table->erp_core->mlxsw_sp; mlxsw_sp 452 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pererp), pererp_pl); mlxsw_sp 532 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c err = mlxsw_sp_acl_bf_entry_add(aregion->region->mlxsw_sp, mlxsw_sp 544 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_sp_acl_bf_entry_del(aregion->region->mlxsw_sp, mlxsw_sp 559 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_sp_acl_bf_entry_del(aregion->region->mlxsw_sp, mlxsw_sp 648 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = erp_table->erp_core->mlxsw_sp; mlxsw_sp 658 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pererp), pererp_pl); mlxsw_sp 665 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = erp_table->erp_core->mlxsw_sp; mlxsw_sp 675 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pererp), pererp_pl); mlxsw_sp 1031 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c int mlxsw_sp_acl_erp_bf_insert(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1044 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c return mlxsw_sp_acl_bf_entry_add(mlxsw_sp, mlxsw_sp 1049 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c void mlxsw_sp_acl_erp_bf_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1062 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_sp_acl_bf_entry_del(mlxsw_sp, mlxsw_sp 1359 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; mlxsw_sp 1363 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(percr), percr_pl); mlxsw_sp 1369 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; mlxsw_sp 1374 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pererp), pererp_pl); mlxsw_sp 1378 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_sp_acl_erp_hints_check(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1393 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to get ERP stats\n"); mlxsw_sp 1399 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to get ERP hints stats\n"); mlxsw_sp 1420 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; mlxsw_sp 1430 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to create ERP hints\n"); mlxsw_sp 1433 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c err = mlxsw_sp_acl_erp_hints_check(mlxsw_sp, aregion, hints, mlxsw_sp 1492 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_sp_acl_erp_tables_sizes_query(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1497 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_ERPT_ENTRIES_2KB) || mlxsw_sp 1498 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c !MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_ERPT_ENTRIES_4KB) || mlxsw_sp 1499 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c !MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_ERPT_ENTRIES_8KB) || mlxsw_sp 1500 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c !MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_ERPT_ENTRIES_12KB)) mlxsw_sp 1503 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c size = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_ERPT_ENTRIES_2KB); mlxsw_sp 1506 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c size = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_ERPT_ENTRIES_4KB); mlxsw_sp 1509 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c size = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_ERPT_ENTRIES_8KB); mlxsw_sp 1512 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c size = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_ERPT_ENTRIES_12KB); mlxsw_sp 1518 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c static int mlxsw_sp_acl_erp_tables_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1524 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_MAX_ERPT_BANK_SIZE) || mlxsw_sp 1525 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c !MLXSW_CORE_RES_VALID(mlxsw_sp->core, ACL_MAX_ERPT_BANKS)) mlxsw_sp 1527 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c erpt_bank_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 1529 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c erp_core->num_erp_banks = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 1543 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c erp_core->bf = mlxsw_sp_acl_bf_init(mlxsw_sp, erp_core->num_erp_banks); mlxsw_sp 1550 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c err = mlxsw_sp_acl_erp_tables_sizes_query(mlxsw_sp, erp_core); mlxsw_sp 1564 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c static void mlxsw_sp_acl_erp_tables_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1571 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c int mlxsw_sp_acl_erps_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1580 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c erp_core->mlxsw_sp = mlxsw_sp; mlxsw_sp 1583 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c err = mlxsw_sp_acl_erp_tables_init(mlxsw_sp, erp_core); mlxsw_sp 1594 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c void mlxsw_sp_acl_erps_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1597 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c mlxsw_sp_acl_erp_tables_fini(mlxsw_sp, atcam->erp_core); mlxsw_sp 11 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 22 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, mlxsw_sp 27 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pefa), pefa_pl); mlxsw_sp 34 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, mlxsw_sp 56 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 60 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, mlxsw_sp 73 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 78 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pefa), pefa_pl); mlxsw_sp 88 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 93 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_PBS, mlxsw_sp 98 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ppbs), ppbs_pl); mlxsw_sp 105 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_PBS, mlxsw_sp 112 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 114 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_PBS, mlxsw_sp 121 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 123 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c return mlxsw_sp_flow_counter_alloc(mlxsw_sp, p_counter_index); mlxsw_sp 129 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 131 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_sp_flow_counter_free(mlxsw_sp, counter_index); mlxsw_sp 140 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 144 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c in_port = mlxsw_sp->ports[local_in_port]; mlxsw_sp 153 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 158 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c in_port = mlxsw_sp->ports[local_in_port]; mlxsw_sp 188 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c int mlxsw_sp_afa_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 190 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_sp->afa = mlxsw_afa_create(MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 192 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_sp->afa_ops, mlxsw_sp); mlxsw_sp 193 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c return PTR_ERR_OR_ZERO(mlxsw_sp->afa); mlxsw_sp 196 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c void mlxsw_sp_afa_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 198 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c mlxsw_afa_destroy(mlxsw_sp->afa); mlxsw_sp 9 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.h int mlxsw_sp_afa_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 10 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.h void mlxsw_sp_afa_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 21 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c size_t mlxsw_sp_acl_tcam_priv_size(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 23 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 32 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 35 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 47 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c max_tcam_regions = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 49 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c max_regions = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_REGIONS); mlxsw_sp 61 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c max_groups = MLXSW_CORE_RES_GET(mlxsw_sp->core, ACL_MAX_GROUPS); mlxsw_sp 69 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c tcam->max_group_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 72 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = ops->init(mlxsw_sp, tcam->priv, tcam); mlxsw_sp 85 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 88 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 91 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c ops->fini(mlxsw_sp, tcam->priv); mlxsw_sp 96 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c int mlxsw_sp_acl_tcam_priority_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 107 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, KVD_SIZE)) mlxsw_sp 111 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c max_priority = MLXSW_CORE_RES_GET(mlxsw_sp->core, KVD_SIZE) - 1; mlxsw_sp 218 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 264 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c static int mlxsw_sp_acl_tcam_group_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 283 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pagt), pagt_pl); mlxsw_sp 313 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vgroup_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 359 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 370 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ppbt), ppbt_pl); mlxsw_sp 374 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 385 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ppbt), ppbt_pl); mlxsw_sp 420 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_region_attach(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 453 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_group_update(mlxsw_sp, group); mlxsw_sp 469 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_region_detach(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 477 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_update(mlxsw_sp, group); mlxsw_sp 482 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vgroup_vregion_attach(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 499 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_group_region_attach(mlxsw_sp, &vgroup->group, mlxsw_sp 513 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vgroup_vregion_detach(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 518 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_region_detach(mlxsw_sp, mlxsw_sp 520 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_region_detach(mlxsw_sp, vregion->region); mlxsw_sp 607 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 627 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptar), ptar_pl); mlxsw_sp 635 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 643 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptar), ptar_pl); mlxsw_sp 647 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_enable(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 654 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pacl), pacl_pl); mlxsw_sp 658 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_disable(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 665 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pacl), pacl_pl); mlxsw_sp 669 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 674 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 681 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c region->mlxsw_sp = mlxsw_sp; mlxsw_sp 689 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = ops->region_associate(mlxsw_sp, region); mlxsw_sp 694 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_region_alloc(mlxsw_sp, region); mlxsw_sp 698 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_region_enable(mlxsw_sp, region); mlxsw_sp 702 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = ops->region_init(mlxsw_sp, region->priv, tcam->priv, mlxsw_sp 710 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_disable(mlxsw_sp, region); mlxsw_sp 712 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_free(mlxsw_sp, region); mlxsw_sp 722 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 725 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 727 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c ops->region_fini(mlxsw_sp, region->priv); mlxsw_sp 728 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_disable(mlxsw_sp, region); mlxsw_sp 729 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_free(mlxsw_sp, region); mlxsw_sp 747 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_rehash(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 758 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_rehash(vregion->mlxsw_sp, vregion, &credits); mlxsw_sp 794 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 799 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 800 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c struct mlxsw_afk *afk = mlxsw_sp_acl_afk(mlxsw_sp->acl); mlxsw_sp 811 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c vregion->mlxsw_sp = mlxsw_sp; mlxsw_sp 821 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c vregion->region = mlxsw_sp_acl_tcam_region_create(mlxsw_sp, tcam, mlxsw_sp 828 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_vgroup_vregion_attach(mlxsw_sp, vgroup, vregion, mlxsw_sp 846 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region); mlxsw_sp 855 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 858 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 868 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vgroup_vregion_detach(mlxsw_sp, vregion); mlxsw_sp 870 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region2); mlxsw_sp 871 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region); mlxsw_sp 877 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c u32 mlxsw_sp_acl_tcam_vregion_rehash_intrvl_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 880 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 889 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c int mlxsw_sp_acl_tcam_vregion_rehash_intrvl_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 893 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 913 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 942 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_vregion_create(mlxsw_sp, vgroup, priority, mlxsw_sp 947 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 952 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_destroy(mlxsw_sp, vregion); mlxsw_sp 956 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_chunk_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 960 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 974 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_chunk_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 977 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 984 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1005 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c vregion = mlxsw_sp_acl_tcam_vregion_get(mlxsw_sp, vgroup, mlxsw_sp 1020 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c vchunk->chunk = mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, mlxsw_sp 1045 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_put(mlxsw_sp, vregion); mlxsw_sp 1052 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1062 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk2); mlxsw_sp 1063 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk); mlxsw_sp 1067 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_put(mlxsw_sp, vchunk->vregion); mlxsw_sp 1072 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1088 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_vchunk_create(mlxsw_sp, vgroup, mlxsw_sp 1093 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1098 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_destroy(mlxsw_sp, vchunk); mlxsw_sp 1102 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_entry_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1106 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 1116 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = ops->entry_add(mlxsw_sp, chunk->region->priv, chunk->priv, mlxsw_sp 1128 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c static void mlxsw_sp_acl_tcam_entry_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1131 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 1133 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c ops->entry_del(mlxsw_sp, entry->chunk->region->priv, mlxsw_sp 1139 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1144 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 1146 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return ops->entry_action_replace(mlxsw_sp, region->priv, mlxsw_sp 1151 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_entry_activity_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1155 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 1157 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return ops->entry_activity_get(mlxsw_sp, entry->chunk->region->priv, mlxsw_sp 1161 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c static int mlxsw_sp_acl_tcam_ventry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1170 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c vchunk = mlxsw_sp_acl_tcam_vchunk_get(mlxsw_sp, vgroup, rulei->priority, mlxsw_sp 1180 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c ventry->entry = mlxsw_sp_acl_tcam_entry_create(mlxsw_sp, ventry, mlxsw_sp 1195 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); mlxsw_sp 1199 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c static void mlxsw_sp_acl_tcam_ventry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1208 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_entry_destroy(mlxsw_sp, ventry->entry); mlxsw_sp 1210 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); mlxsw_sp 1214 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_ventry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1220 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_entry_action_replace(mlxsw_sp, mlxsw_sp 1226 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_ventry_activity_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1230 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_entry_activity_get(mlxsw_sp, mlxsw_sp 1235 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_ventry_migrate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1249 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c new_entry = mlxsw_sp_acl_tcam_entry_create(mlxsw_sp, ventry, chunk); mlxsw_sp 1252 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_entry_destroy(mlxsw_sp, ventry->entry); mlxsw_sp 1258 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_migrate_start(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1265 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c new_chunk = mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, region); mlxsw_sp 1277 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_migrate_end(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1281 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk2); mlxsw_sp 1287 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1297 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_vchunk_migrate_start(mlxsw_sp, vchunk, mlxsw_sp 1322 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_ventry_migrate(mlxsw_sp, ventry, mlxsw_sp 1355 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_migrate_end(mlxsw_sp, vchunk, ctx); mlxsw_sp 1360 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_migrate_all(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1378 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_vchunk_migrate_one(mlxsw_sp, vchunk, mlxsw_sp 1388 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1395 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c trace_mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion); mlxsw_sp 1397 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_vchunk_migrate_all(mlxsw_sp, vregion, mlxsw_sp 1407 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err2 = mlxsw_sp_acl_tcam_vchunk_migrate_all(mlxsw_sp, vregion, mlxsw_sp 1410 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c trace_mlxsw_sp_acl_tcam_vregion_rehash_rollback_failed(mlxsw_sp, mlxsw_sp 1412 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c dev_err(mlxsw_sp->bus_info->dev, "Failed to rollback during vregion migration fail\n"); mlxsw_sp 1417 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c trace_mlxsw_sp_acl_tcam_vregion_migrate_end(mlxsw_sp, vregion); mlxsw_sp 1428 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_rehash_start(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1432 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 1438 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c trace_mlxsw_sp_acl_tcam_vregion_rehash(mlxsw_sp, vregion); mlxsw_sp 1444 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c new_region = mlxsw_sp_acl_tcam_region_create(mlxsw_sp, vregion->tcam, mlxsw_sp 1456 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_group_region_attach(mlxsw_sp, mlxsw_sp 1471 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, new_region); mlxsw_sp 1478 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_rehash_end(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1483 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops; mlxsw_sp 1486 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_region_detach(mlxsw_sp, unused_region); mlxsw_sp 1487 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, unused_region); mlxsw_sp 1493 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_rehash(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1505 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_vregion_rehash_start(mlxsw_sp, mlxsw_sp 1509 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c dev_err(mlxsw_sp->bus_info->dev, "Failed get rehash hints\n"); mlxsw_sp 1514 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion, mlxsw_sp 1517 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c dev_err(mlxsw_sp->bus_info->dev, "Failed to migrate vregion\n"); mlxsw_sp 1521 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vregion_rehash_end(mlxsw_sp, vregion, ctx); mlxsw_sp 1582 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_ruleset_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1589 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_vgroup_add(mlxsw_sp, tcam, &ruleset->vgroup, mlxsw_sp 1596 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_ruleset_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1605 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_ruleset_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1612 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_group_bind(mlxsw_sp, &ruleset->vgroup.group, mlxsw_sp 1617 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_ruleset_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1624 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_group_unbind(mlxsw_sp, &ruleset->vgroup.group, mlxsw_sp 1637 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_rule_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1644 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_ventry_add(mlxsw_sp, &ruleset->vgroup, mlxsw_sp 1649 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_rule_del(struct mlxsw_sp *mlxsw_sp, void *rule_priv) mlxsw_sp 1653 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_ventry_del(mlxsw_sp, &rule->ventry); mlxsw_sp 1657 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_rule_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1665 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_flower_rule_activity_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1670 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_ventry_activity_get(mlxsw_sp, &rule->ventry, mlxsw_sp 1698 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_ruleset_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1706 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c err = mlxsw_sp_acl_tcam_vgroup_add(mlxsw_sp, tcam, &ruleset->vgroup, mlxsw_sp 1719 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c ruleset->vchunk = mlxsw_sp_acl_tcam_vchunk_get(mlxsw_sp, mlxsw_sp 1735 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_ruleset_del(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv) mlxsw_sp 1739 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, ruleset->vchunk); mlxsw_sp 1744 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_ruleset_bind(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, mlxsw_sp 1753 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_ruleset_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1769 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_rule_add(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, mlxsw_sp 1776 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_ventry_add(mlxsw_sp, &ruleset->vgroup, mlxsw_sp 1781 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_rule_del(struct mlxsw_sp *mlxsw_sp, void *rule_priv) mlxsw_sp 1785 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_ventry_del(mlxsw_sp, &rule->ventry); mlxsw_sp 1789 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_rule_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1795 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_ventry_action_replace(mlxsw_sp, &rule->ventry, mlxsw_sp 1800 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_mr_rule_activity_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1805 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c return mlxsw_sp_acl_tcam_ventry_activity_get(mlxsw_sp, &rule->ventry, mlxsw_sp 1830 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c mlxsw_sp_acl_tcam_profile_ops(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 27 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h size_t mlxsw_sp_acl_tcam_priv_size(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 28 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 30 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 32 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h u32 mlxsw_sp_acl_tcam_vregion_rehash_intrvl_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 34 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_tcam_vregion_rehash_intrvl_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 37 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_tcam_priority_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 43 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int (*ruleset_add)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 46 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void (*ruleset_del)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv); mlxsw_sp 47 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int (*ruleset_bind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, mlxsw_sp 50 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void (*ruleset_unbind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, mlxsw_sp 55 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int (*rule_add)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 58 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void (*rule_del)(struct mlxsw_sp *mlxsw_sp, void *rule_priv); mlxsw_sp 59 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int (*rule_action_replace)(struct mlxsw_sp *mlxsw_sp, void *rule_priv, mlxsw_sp 61 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int (*rule_activity_get)(struct mlxsw_sp *mlxsw_sp, void *rule_priv, mlxsw_sp 66 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h mlxsw_sp_acl_tcam_profile_ops(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 88 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h struct mlxsw_sp *mlxsw_sp; mlxsw_sp 116 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h mlxsw_sp_acl_ctcam_region_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 125 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_ctcam_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 131 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void mlxsw_sp_acl_ctcam_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 135 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_ctcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 212 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_atcam_region_associate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 215 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 226 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_atcam_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 231 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void mlxsw_sp_acl_atcam_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 235 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_atcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 239 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_atcam_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 241 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void mlxsw_sp_acl_atcam_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 268 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_erp_bf_insert(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 272 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void mlxsw_sp_acl_erp_bf_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 282 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h int mlxsw_sp_acl_erps_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 284 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h void mlxsw_sp_acl_erps_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 290 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h mlxsw_sp_acl_bf_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 296 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h mlxsw_sp_acl_bf_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 302 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h mlxsw_sp_acl_bf_init(struct mlxsw_sp *mlxsw_sp, unsigned int num_erp_banks); mlxsw_sp 123 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c u32 mlxsw_sp_cells_bytes(const struct mlxsw_sp *mlxsw_sp, u32 cells) mlxsw_sp 125 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp->sb->cell_size * cells; mlxsw_sp 128 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c u32 mlxsw_sp_bytes_cells(const struct mlxsw_sp *mlxsw_sp, u32 bytes) mlxsw_sp 130 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return DIV_ROUND_UP(bytes, mlxsw_sp->sb->cell_size); mlxsw_sp 133 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c u32 mlxsw_sp_sb_max_headroom_cells(const struct mlxsw_sp *mlxsw_sp) mlxsw_sp 135 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp->sb->max_headroom_cells; mlxsw_sp 138 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static struct mlxsw_sp_sb_pr *mlxsw_sp_sb_pr_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 141 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return &mlxsw_sp->sb->prs[pool_index]; mlxsw_sp 152 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static struct mlxsw_sp_sb_cm *mlxsw_sp_sb_cm_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 156 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_port *sb_port = &mlxsw_sp->sb->ports[local_port]; mlxsw_sp 165 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static struct mlxsw_sp_sb_pm *mlxsw_sp_sb_pm_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 168 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return &mlxsw_sp->sb->ports[local_port].pms[pool_index]; mlxsw_sp 171 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_pr_write(struct mlxsw_sp *mlxsw_sp, u16 pool_index, mlxsw_sp 176 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c &mlxsw_sp->sb_vals->pool_dess[pool_index]; mlxsw_sp 183 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbpr), sbpr_pl); mlxsw_sp 188 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c size = mlxsw_sp_bytes_cells(mlxsw_sp, mlxsw_sp->sb->sb_size); mlxsw_sp 189 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pr = mlxsw_sp_sb_pr_get(mlxsw_sp, pool_index); mlxsw_sp 195 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_cm_write(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 200 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c &mlxsw_sp->sb_vals->pool_dess[pool_index]; mlxsw_sp 207 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbcm), sbcm_pl); mlxsw_sp 213 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c max_buff = mlxsw_sp_bytes_cells(mlxsw_sp, mlxsw_sp 214 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->sb_size); mlxsw_sp 216 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c cm = mlxsw_sp_sb_cm_get(mlxsw_sp, local_port, pg_buff, mlxsw_sp 225 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_pm_write(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 229 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c &mlxsw_sp->sb_vals->pool_dess[pool_index]; mlxsw_sp 236 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbpm), sbpm_pl); mlxsw_sp 240 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pm = mlxsw_sp_sb_pm_get(mlxsw_sp, local_port, pool_index); mlxsw_sp 246 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_pm_occ_clear(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 250 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c &mlxsw_sp->sb_vals->pool_dess[pool_index]; mlxsw_sp 259 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_reg_trans_query(mlxsw_sp->core, MLXSW_REG(sbpm), sbpm_pl, mlxsw_sp 272 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_pm_occ_query(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 276 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c &mlxsw_sp->sb_vals->pool_dess[pool_index]; mlxsw_sp 284 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pm = mlxsw_sp_sb_pm_get(mlxsw_sp, local_port, pool_index); mlxsw_sp 287 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_reg_trans_query(mlxsw_sp->core, MLXSW_REG(sbpm), sbpm_pl, mlxsw_sp 303 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 310 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c u16 size = mlxsw_sp_bytes_cells(mlxsw_sp, pbs[i]); mlxsw_sp 318 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl); mlxsw_sp 329 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pptb), mlxsw_sp 343 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_port_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 348 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pms = kcalloc(mlxsw_sp->sb_vals->pool_count, sizeof(*pms), mlxsw_sp 361 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_ports_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 363 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c unsigned int max_ports = mlxsw_core_max_ports(mlxsw_sp->core); mlxsw_sp 368 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->ports = kcalloc(max_ports, mlxsw_sp 371 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!mlxsw_sp->sb->ports) mlxsw_sp 374 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c prs = kcalloc(mlxsw_sp->sb_vals->pool_count, sizeof(*prs), mlxsw_sp 380 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->prs = prs; mlxsw_sp 383 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_port_init(mlxsw_sp, &mlxsw_sp->sb->ports[i]); mlxsw_sp 392 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp_sb_port_fini(&mlxsw_sp->sb->ports[i]); mlxsw_sp 393 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c kfree(mlxsw_sp->sb->prs); mlxsw_sp 395 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c kfree(mlxsw_sp->sb->ports); mlxsw_sp 399 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static void mlxsw_sp_sb_ports_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 401 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c int max_ports = mlxsw_core_max_ports(mlxsw_sp->core); mlxsw_sp 405 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp_sb_port_fini(&mlxsw_sp->sb->ports[i]); mlxsw_sp 406 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c kfree(mlxsw_sp->sb->prs); mlxsw_sp 407 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c kfree(mlxsw_sp->sb->ports); mlxsw_sp 472 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_prs_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 484 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_pr_write(mlxsw_sp, i, prs[i].mode, mlxsw_sp 487 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c size_cells = mlxsw_sp_bytes_cells(mlxsw_sp, size); mlxsw_sp 488 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_pr_write(mlxsw_sp, i, prs[i].mode, mlxsw_sp 631 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp_sb_pool_is_static(struct mlxsw_sp *mlxsw_sp, u16 pool_index) mlxsw_sp 633 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_pr *pr = mlxsw_sp_sb_pr_get(mlxsw_sp, pool_index); mlxsw_sp 638 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int __mlxsw_sp_sb_cms_init(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 643 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c const struct mlxsw_sp_sb_vals *sb_vals = mlxsw_sp->sb_vals; mlxsw_sp 658 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, cm->min_buff); mlxsw_sp 661 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_cm_write(mlxsw_sp, local_port, i, mlxsw_sp 665 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (mlxsw_sp_sb_pool_is_static(mlxsw_sp, mlxsw_sp 667 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c max_buff = mlxsw_sp_bytes_cells(mlxsw_sp, mlxsw_sp 669 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_cm_write(mlxsw_sp, local_port, i, mlxsw_sp 681 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 684 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = __mlxsw_sp_sb_cms_init(mlxsw_sp, mlxsw_sp 687 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->cms_ingress, mlxsw_sp 688 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->cms_ingress_count); mlxsw_sp 691 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return __mlxsw_sp_sb_cms_init(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 694 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->cms_egress, mlxsw_sp 695 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->cms_egress_count); mlxsw_sp 698 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_cpu_port_sb_cms_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 700 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return __mlxsw_sp_sb_cms_init(mlxsw_sp, 0, MLXSW_REG_SBXX_DIR_EGRESS, mlxsw_sp 701 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->cms_cpu, mlxsw_sp 702 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->cms_cpu_count); mlxsw_sp 756 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_pms_init(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 762 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c for (i = 0; i < mlxsw_sp->sb_vals->pool_count; i++) { mlxsw_sp 768 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c des = &mlxsw_sp->sb_vals->pool_dess[i]; mlxsw_sp 772 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, pm->min_buff); mlxsw_sp 774 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (mlxsw_sp_sb_pool_is_static(mlxsw_sp, i)) mlxsw_sp 775 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c max_buff = mlxsw_sp_bytes_cells(mlxsw_sp, max_buff); mlxsw_sp 776 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_pm_write(mlxsw_sp, local_port, i, min_buff, mlxsw_sp 786 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 788 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp_sb_pms_init(mlxsw_sp, mlxsw_sp_port->local_port, mlxsw_sp 789 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->pms, false); mlxsw_sp 792 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_cpu_port_sb_pms_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 794 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp_sb_pms_init(mlxsw_sp, 0, mlxsw_sp->sb_vals->pms_cpu, mlxsw_sp 823 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_mms_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 829 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c for (i = 0; i < mlxsw_sp->sb_vals->mms_count; i++) { mlxsw_sp 834 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mc = &mlxsw_sp->sb_vals->mms[i]; mlxsw_sp 835 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c des = &mlxsw_sp->sb_vals->pool_dess[mc->pool_index]; mlxsw_sp 839 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, mc->min_buff); mlxsw_sp 842 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbmm), sbmm_pl); mlxsw_sp 849 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static void mlxsw_sp_pool_count(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 854 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c for (i = 0; i < mlxsw_sp->sb_vals->pool_count; ++i) { mlxsw_sp 855 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (mlxsw_sp->sb_vals->pool_dess[i].dir == mlxsw_sp 897 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 904 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, CELL_SIZE)) mlxsw_sp 907 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_BUFFER_SIZE)) mlxsw_sp 910 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_HEADROOM_SIZE)) mlxsw_sp 913 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb = kzalloc(sizeof(*mlxsw_sp->sb), GFP_KERNEL); mlxsw_sp 914 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!mlxsw_sp->sb) mlxsw_sp 916 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->cell_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, CELL_SIZE); mlxsw_sp 917 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->sb_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 919 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c max_headroom_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 922 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->max_headroom_cells = max_headroom_size / mlxsw_sp 923 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->cell_size; mlxsw_sp 925 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_ports_init(mlxsw_sp); mlxsw_sp 928 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_prs_init(mlxsw_sp, mlxsw_sp->sb_vals->prs, mlxsw_sp 929 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb_vals->pool_count); mlxsw_sp 932 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_cpu_port_sb_cms_init(mlxsw_sp); mlxsw_sp 935 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_cpu_port_sb_pms_init(mlxsw_sp); mlxsw_sp 938 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_mms_init(mlxsw_sp); mlxsw_sp 941 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp_pool_count(mlxsw_sp, &ing_pool_count, &eg_pool_count); mlxsw_sp 942 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = devlink_sb_register(priv_to_devlink(mlxsw_sp->core), 0, mlxsw_sp 943 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp->sb->sb_size, mlxsw_sp 958 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp_sb_ports_fini(mlxsw_sp); mlxsw_sp 960 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c kfree(mlxsw_sp->sb); mlxsw_sp 964 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c void mlxsw_sp_buffers_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 966 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c devlink_sb_unregister(priv_to_devlink(mlxsw_sp->core), 0); mlxsw_sp 967 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c mlxsw_sp_sb_ports_fini(mlxsw_sp); mlxsw_sp 968 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c kfree(mlxsw_sp->sb); mlxsw_sp 990 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 994 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c dir = mlxsw_sp->sb_vals->pool_dess[pool_index].dir; mlxsw_sp 995 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pr = mlxsw_sp_sb_pr_get(mlxsw_sp, pool_index); mlxsw_sp 997 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pool_info->size = mlxsw_sp_cells_bytes(mlxsw_sp, pr->size); mlxsw_sp 999 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pool_info->cell_size = mlxsw_sp->sb->cell_size; mlxsw_sp 1008 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 1009 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c u32 pool_size = mlxsw_sp_bytes_cells(mlxsw_sp, size); mlxsw_sp 1014 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c pr = &mlxsw_sp->sb_vals->prs[pool_index]; mlxsw_sp 1016 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (size > MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_BUFFER_SIZE)) { mlxsw_sp 1031 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp_sb_pr_write(mlxsw_sp, pool_index, mode, mlxsw_sp 1037 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static u32 mlxsw_sp_sb_threshold_out(struct mlxsw_sp *mlxsw_sp, u16 pool_index, mlxsw_sp 1040 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_pr *pr = mlxsw_sp_sb_pr_get(mlxsw_sp, pool_index); mlxsw_sp 1044 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp_cells_bytes(mlxsw_sp, max_buff); mlxsw_sp 1047 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c static int mlxsw_sp_sb_threshold_in(struct mlxsw_sp *mlxsw_sp, u16 pool_index, mlxsw_sp 1051 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_pr *pr = mlxsw_sp_sb_pr_get(mlxsw_sp, pool_index); mlxsw_sp 1064 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c *p_max_buff = mlxsw_sp_bytes_cells(mlxsw_sp, threshold); mlxsw_sp 1075 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1077 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_pm *pm = mlxsw_sp_sb_pm_get(mlxsw_sp, local_port, mlxsw_sp 1080 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c *p_threshold = mlxsw_sp_sb_threshold_out(mlxsw_sp, pool_index, mlxsw_sp 1091 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1101 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_threshold_in(mlxsw_sp, pool_index, mlxsw_sp 1106 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp_sb_pm_write(mlxsw_sp, local_port, pool_index, mlxsw_sp 1117 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1121 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_cm *cm = mlxsw_sp_sb_cm_get(mlxsw_sp, local_port, mlxsw_sp 1124 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c *p_threshold = mlxsw_sp_sb_threshold_out(mlxsw_sp, cm->pool_index, mlxsw_sp 1138 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1151 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (dir != mlxsw_sp->sb_vals->pool_dess[pool_index].dir) { mlxsw_sp 1157 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c cm = &mlxsw_sp->sb_vals->cms_ingress[tc_index]; mlxsw_sp 1159 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c cm = &mlxsw_sp->sb_vals->cms_egress[tc_index]; mlxsw_sp 1171 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_threshold_in(mlxsw_sp, pool_index, mlxsw_sp 1176 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c return mlxsw_sp_sb_cm_write(mlxsw_sp, local_port, pg_buff, mlxsw_sp 1193 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 1206 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!mlxsw_sp->ports[local_port]) mlxsw_sp 1214 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c cm = mlxsw_sp_sb_cm_get(mlxsw_sp, local_port, i, mlxsw_sp 1225 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!mlxsw_sp->ports[local_port]) mlxsw_sp 1228 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c cm = mlxsw_sp_sb_cm_get(mlxsw_sp, local_port, i, mlxsw_sp 1241 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 1267 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!mlxsw_sp->ports[local_port]) mlxsw_sp 1275 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c for (i = 0; i < mlxsw_sp->sb_vals->pool_count; i++) { mlxsw_sp 1276 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_pm_occ_query(mlxsw_sp, local_port, i, mlxsw_sp 1310 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 1332 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c if (!mlxsw_sp->ports[local_port]) mlxsw_sp 1340 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c for (i = 0; i < mlxsw_sp->sb_vals->pool_count; i++) { mlxsw_sp 1341 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c err = mlxsw_sp_sb_pm_occ_clear(mlxsw_sp, local_port, i, mlxsw_sp 1374 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1376 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_pm *pm = mlxsw_sp_sb_pm_get(mlxsw_sp, local_port, mlxsw_sp 1379 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c *p_cur = mlxsw_sp_cells_bytes(mlxsw_sp, pm->occ.cur); mlxsw_sp 1380 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c *p_max = mlxsw_sp_cells_bytes(mlxsw_sp, pm->occ.max); mlxsw_sp 1391 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1395 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c struct mlxsw_sp_sb_cm *cm = mlxsw_sp_sb_cm_get(mlxsw_sp, local_port, mlxsw_sp 1398 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c *p_cur = mlxsw_sp_cells_bytes(mlxsw_sp, cm->occ.cur); mlxsw_sp 1399 drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c *p_max = mlxsw_sp_cells_bytes(mlxsw_sp, cm->occ.max); mlxsw_sp 33 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c static int mlxsw_sp_counter_pool_validate(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 39 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c pool_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, COUNTER_POOL_SIZE); mlxsw_sp 48 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c static int mlxsw_sp_counter_sub_pools_prepare(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 54 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, COUNTER_SIZE_PACKETS_BYTES)) mlxsw_sp 56 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c sub_pool->entry_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 60 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, COUNTER_SIZE_ROUTER_BASIC)) mlxsw_sp 62 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c sub_pool->entry_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 67 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c int mlxsw_sp_counter_pool_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 76 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, COUNTER_POOL_SIZE)) mlxsw_sp 79 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c err = mlxsw_sp_counter_pool_validate(mlxsw_sp); mlxsw_sp 83 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c err = mlxsw_sp_counter_sub_pools_prepare(mlxsw_sp); mlxsw_sp 91 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c pool->pool_size = MLXSW_CORE_RES_GET(mlxsw_sp->core, COUNTER_POOL_SIZE); mlxsw_sp 116 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c mlxsw_sp->counter_pool = pool; mlxsw_sp 124 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c void mlxsw_sp_counter_pool_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 126 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c struct mlxsw_sp_counter_pool *pool = mlxsw_sp->counter_pool; mlxsw_sp 134 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c int mlxsw_sp_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 138 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c struct mlxsw_sp_counter_pool *pool = mlxsw_sp->counter_pool; mlxsw_sp 163 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c void mlxsw_sp_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 167 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c struct mlxsw_sp_counter_pool *pool = mlxsw_sp->counter_pool; mlxsw_sp 14 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h int mlxsw_sp_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 17 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h void mlxsw_sp_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 20 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h int mlxsw_sp_counter_pool_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 21 drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h void mlxsw_sp_counter_pool_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 77 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pptb), mlxsw_sp 94 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 99 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl); mlxsw_sp 110 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl); mlxsw_sp 325 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 329 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qpts), qpts_pl); mlxsw_sp 336 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 341 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qrwe), qrwe_pl); mlxsw_sp 375 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 382 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qpdpm), qpdpm_pl); mlxsw_sp 389 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 396 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qpdsm), qpdsm_pl); mlxsw_sp 534 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 541 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ppcnt), ppcnt_pl); mlxsw_sp 581 drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c return mlxsw_reg_write(mlxsw_sp_port->mlxsw_sp->core, MLXSW_REG(pfcc), mlxsw_sp 153 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static int mlxsw_sp_erif_entry_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 180 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_rif_counter_value_get(mlxsw_sp, rif, mlxsw_sp 198 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 212 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c rif_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); mlxsw_sp 221 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); mlxsw_sp 225 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_erif_entry_get(mlxsw_sp, &entry, rif, mlxsw_sp 258 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 262 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { mlxsw_sp 263 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); mlxsw_sp 268 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_rif_counter_alloc(mlxsw_sp, rif, mlxsw_sp 271 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_rif_counter_free(mlxsw_sp, rif, mlxsw_sp 280 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 282 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c return MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); mlxsw_sp 293 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static int mlxsw_sp_dpipe_erif_table_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 295 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 300 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp, false); mlxsw_sp 303 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static void mlxsw_sp_dpipe_erif_table_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 305 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 509 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_entry_fill(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 529 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_neigh_counter_get(mlxsw_sp, neigh_entry, mlxsw_sp 536 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_entries_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 551 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c rif_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); mlxsw_sp 558 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c for (; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { mlxsw_sp 559 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); mlxsw_sp 579 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_entry_fill(mlxsw_sp, entry, mlxsw_sp 615 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_entries_dump(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 640 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_dpipe_table_host_entries_get(mlxsw_sp, &entry, mlxsw_sp 652 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 654 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c return mlxsw_sp_dpipe_table_host_entries_dump(mlxsw_sp, mlxsw_sp 660 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_counters_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 666 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { mlxsw_sp 667 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); mlxsw_sp 682 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_neigh_entry_counter_update(mlxsw_sp, mlxsw_sp 692 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 694 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_counters_update(mlxsw_sp, enable, AF_INET); mlxsw_sp 699 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_size_get(struct mlxsw_sp *mlxsw_sp, int type) mlxsw_sp 705 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { mlxsw_sp 706 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); mlxsw_sp 731 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 733 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c return mlxsw_sp_dpipe_table_host_size_get(mlxsw_sp, AF_INET); mlxsw_sp 746 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static int mlxsw_sp_dpipe_host4_table_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 748 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 754 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp, false); mlxsw_sp 773 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static void mlxsw_sp_dpipe_host4_table_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 775 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 791 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 793 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c return mlxsw_sp_dpipe_table_host_entries_dump(mlxsw_sp, mlxsw_sp 800 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 802 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_host_counters_update(mlxsw_sp, enable, AF_INET6); mlxsw_sp 808 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 810 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c return mlxsw_sp_dpipe_table_host_size_get(mlxsw_sp, AF_INET6); mlxsw_sp 823 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static int mlxsw_sp_dpipe_host6_table_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 825 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 831 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp, false); mlxsw_sp 850 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static void mlxsw_sp_dpipe_host6_table_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 852 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 908 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static u64 mlxsw_sp_dpipe_table_adj_size(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 913 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) mlxsw_sp 1063 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static void mlxsw_sp_dpipe_table_adj_entry_fill(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1077 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &entry->counter); mlxsw_sp 1083 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_adj_entries_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1097 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c nh_count_max = mlxsw_sp_dpipe_table_adj_size(mlxsw_sp); mlxsw_sp 1105 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) { mlxsw_sp 1113 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_table_adj_entry_fill(mlxsw_sp, nh, entry); mlxsw_sp 1152 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 1171 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_dpipe_table_adj_entries_get(mlxsw_sp, &entry, mlxsw_sp 1180 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 1186 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) { mlxsw_sp 1194 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh); mlxsw_sp 1196 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh); mlxsw_sp 1197 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_nexthop_update(mlxsw_sp, mlxsw_sp 1206 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp 1210 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c size = mlxsw_sp_dpipe_table_adj_size(mlxsw_sp); mlxsw_sp 1226 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static int mlxsw_sp_dpipe_adj_table_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1228 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 1234 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp, false); mlxsw_sp 1253 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c static void mlxsw_sp_dpipe_adj_table_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1255 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 1261 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1263 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 1270 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_dpipe_erif_table_init(mlxsw_sp); mlxsw_sp 1274 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_dpipe_host4_table_init(mlxsw_sp); mlxsw_sp 1278 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_dpipe_host6_table_init(mlxsw_sp); mlxsw_sp 1282 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c err = mlxsw_sp_dpipe_adj_table_init(mlxsw_sp); mlxsw_sp 1288 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_host6_table_fini(mlxsw_sp); mlxsw_sp 1290 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_host4_table_fini(mlxsw_sp); mlxsw_sp 1292 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_erif_table_fini(mlxsw_sp); mlxsw_sp 1294 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c devlink_dpipe_headers_unregister(priv_to_devlink(mlxsw_sp->core)); mlxsw_sp 1298 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1300 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 1302 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_adj_table_fini(mlxsw_sp); mlxsw_sp 1303 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_host6_table_fini(mlxsw_sp); mlxsw_sp 1304 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_host4_table_fini(mlxsw_sp); mlxsw_sp 1305 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c mlxsw_sp_dpipe_erif_table_fini(mlxsw_sp); mlxsw_sp 7 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 8 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.h void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 103 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 129 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c bool mlxsw_sp_fid_is_dummy(struct mlxsw_sp *mlxsw_sp, u16 fid_index) mlxsw_sp 134 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid_family = mlxsw_sp->fid_core->fid_family_arr[fid_type]; mlxsw_sp 144 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_index(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 149 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid = rhashtable_lookup_fast(&mlxsw_sp->fid_core->fid_ht, &fid_index, mlxsw_sp 178 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_vni(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 183 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid = rhashtable_lookup_fast(&mlxsw_sp->fid_core->vni_ht, &vni, mlxsw_sp 243 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; mlxsw_sp 252 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = rhashtable_lookup_insert_fast(&mlxsw_sp->fid_core->vni_ht, mlxsw_sp 267 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c rhashtable_remove_fast(&mlxsw_sp->fid_core->vni_ht, &fid->vni_ht_node, mlxsw_sp 276 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; mlxsw_sp 283 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c rhashtable_remove_fast(&mlxsw_sp->fid_core->vni_ht, &fid->vni_ht_node, mlxsw_sp 342 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = mlxsw_reg_write(fid_family->mlxsw_sp->core, MLXSW_REG(sftr), mlxsw_sp 383 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_type_rif_type(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 386 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid_core *fid_core = mlxsw_sp->fid_core; mlxsw_sp 415 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c static int mlxsw_sp_fid_op(struct mlxsw_sp *mlxsw_sp, u16 fid_index, mlxsw_sp 422 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfmr), sfmr_pl); mlxsw_sp 425 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c static int mlxsw_sp_fid_vni_op(struct mlxsw_sp *mlxsw_sp, u16 fid_index, mlxsw_sp 437 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfmr), sfmr_pl); mlxsw_sp 440 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c static int mlxsw_sp_fid_vid_map(struct mlxsw_sp *mlxsw_sp, u16 fid_index, mlxsw_sp 447 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(svfa), svfa_pl); mlxsw_sp 450 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c static int __mlxsw_sp_fid_port_vid_map(struct mlxsw_sp *mlxsw_sp, u16 fid_index, mlxsw_sp 457 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(svfa), svfa_pl); mlxsw_sp 462 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; mlxsw_sp 466 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = mlxsw_sp_fid_op(mlxsw_sp, fid->fid_index, fid->fid_index, true); mlxsw_sp 471 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = mlxsw_sp_fid_vid_map(mlxsw_sp, fid->fid_index, fid_8021q->vid, mlxsw_sp 479 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_op(mlxsw_sp, fid->fid_index, 0, false); mlxsw_sp 485 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; mlxsw_sp 489 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_vid_map(mlxsw_sp, fid->fid_index, fid_8021q->vid, false); mlxsw_sp 490 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_op(mlxsw_sp, fid->fid_index, 0, false); mlxsw_sp 524 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 531 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c if (mlxsw_sp->fid_core->port_fid_mappings[local_port] == 0) mlxsw_sp 533 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, local_port, mlxsw_sp 541 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 544 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c if (mlxsw_sp->fid_core->port_fid_mappings[local_port] == 0) mlxsw_sp 546 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, local_port, vid, mlxsw_sp 611 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_op(fid_family->mlxsw_sp, fid->fid_index, 0, true); mlxsw_sp 617 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_nve_fid_disable(fid->fid_family->mlxsw_sp, fid); mlxsw_sp 618 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_op(fid->fid_family->mlxsw_sp, fid->fid_index, 0, false); mlxsw_sp 651 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 663 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, mlxsw_sp 686 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, mlxsw_sp 695 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 708 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, mlxsw_sp 718 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 722 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, mlxsw_sp 727 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c if (mlxsw_sp->fid_core->port_fid_mappings[local_port]++ == 0) { mlxsw_sp 736 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->port_fid_mappings[local_port]--; mlxsw_sp 737 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, mlxsw_sp 746 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 749 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c if (mlxsw_sp->fid_core->port_fid_mappings[local_port] == 1) mlxsw_sp 751 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->port_fid_mappings[local_port]--; mlxsw_sp 752 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c __mlxsw_sp_fid_port_vid_map(mlxsw_sp, fid->fid_index, mlxsw_sp 760 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, vni, mlxsw_sp 769 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, 0, false, mlxsw_sp 778 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, mlxsw_sp 787 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_vni_op(fid_family->mlxsw_sp, fid->fid_index, fid->vni, mlxsw_sp 921 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 928 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c if (mlxsw_sp->fid_core->port_fid_mappings[local_port]++ == 0) { mlxsw_sp 937 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->port_fid_mappings[local_port]--; mlxsw_sp 945 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 948 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c if (mlxsw_sp->fid_core->port_fid_mappings[local_port] == 1) mlxsw_sp 950 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->port_fid_mappings[local_port]--; mlxsw_sp 976 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; mlxsw_sp 978 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_op(mlxsw_sp, fid->fid_index, 0, true); mlxsw_sp 983 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_op(fid->fid_family->mlxsw_sp, fid->fid_index, 0, false); mlxsw_sp 1022 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c static struct mlxsw_sp_fid *mlxsw_sp_fid_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1029 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid_family = mlxsw_sp->fid_core->fid_family_arr[type]; mlxsw_sp 1040 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c static struct mlxsw_sp_fid *mlxsw_sp_fid_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1049 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid = mlxsw_sp_fid_lookup(mlxsw_sp, type, arg); mlxsw_sp 1053 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid_family = mlxsw_sp->fid_core->fid_family_arr[type]; mlxsw_sp 1072 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = rhashtable_insert_fast(&mlxsw_sp->fid_core->fid_ht, &fid->ht_node, mlxsw_sp 1094 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; mlxsw_sp 1100 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c rhashtable_remove_fast(&mlxsw_sp->fid_core->fid_ht, mlxsw_sp 1108 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_8021q_get(struct mlxsw_sp *mlxsw_sp, u16 vid) mlxsw_sp 1110 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_get(mlxsw_sp, MLXSW_SP_FID_TYPE_8021Q, &vid); mlxsw_sp 1113 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_8021d_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1116 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_get(mlxsw_sp, MLXSW_SP_FID_TYPE_8021D, &br_ifindex); mlxsw_sp 1119 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_8021q_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1122 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_lookup(mlxsw_sp, MLXSW_SP_FID_TYPE_8021Q, &vid); mlxsw_sp 1125 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_8021d_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1128 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_lookup(mlxsw_sp, MLXSW_SP_FID_TYPE_8021D, mlxsw_sp 1132 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_rfid_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1135 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_get(mlxsw_sp, MLXSW_SP_FID_TYPE_RFID, &rif_index); mlxsw_sp 1138 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid *mlxsw_sp_fid_dummy_get(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1140 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c return mlxsw_sp_fid_get(mlxsw_sp, MLXSW_SP_FID_TYPE_DUMMY, NULL); mlxsw_sp 1153 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; mlxsw_sp 1162 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfgc), sfgc_pl); mlxsw_sp 1188 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c static int mlxsw_sp_fid_family_register(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1199 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid_family->mlxsw_sp = mlxsw_sp; mlxsw_sp 1213 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->fid_family_arr[tmpl->type] = fid_family; mlxsw_sp 1225 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_family_unregister(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1228 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->fid_family_arr[fid_family->type] = NULL; mlxsw_sp 1236 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1242 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->port_fid_mappings[mlxsw_sp_port->local_port] = 0; mlxsw_sp 1249 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1251 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core->port_fid_mappings[mlxsw_sp_port->local_port] = 0; mlxsw_sp 1254 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c int mlxsw_sp_fids_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1256 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c unsigned int max_ports = mlxsw_core_max_ports(mlxsw_sp->core); mlxsw_sp 1260 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c fid_core = kzalloc(sizeof(*mlxsw_sp->fid_core), GFP_KERNEL); mlxsw_sp 1263 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp->fid_core = fid_core; mlxsw_sp 1281 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c err = mlxsw_sp_fid_family_register(mlxsw_sp, mlxsw_sp 1295 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_family_unregister(mlxsw_sp, fid_family); mlxsw_sp 1307 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c void mlxsw_sp_fids_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1309 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c struct mlxsw_sp_fid_core *fid_core = mlxsw_sp->fid_core; mlxsw_sp 1313 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c mlxsw_sp_fid_family_unregister(mlxsw_sp, mlxsw_sp 17 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 31 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack); mlxsw_sp 63 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c ruleset = mlxsw_sp_acl_ruleset_lookup(mlxsw_sp, block, mlxsw_sp 92 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c fid = mlxsw_sp_acl_dummy_fid(mlxsw_sp); mlxsw_sp 94 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_acl_rulei_act_fid_set(mlxsw_sp, rulei, mlxsw_sp 100 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_acl_rulei_act_fwd(mlxsw_sp, rulei, mlxsw_sp 114 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_acl_rulei_act_mirror(mlxsw_sp, rulei, mlxsw_sp 126 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_acl_rulei_act_vlan(mlxsw_sp, rulei, mlxsw_sp 135 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c dev_err(mlxsw_sp->bus_info->dev, "Unsupported action\n"); mlxsw_sp 173 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c if (mlxsw_sp_port->mlxsw_sp != block->mlxsw_sp) { mlxsw_sp 233 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c static int mlxsw_sp_flower_parse_ports(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 246 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c dev_err(mlxsw_sp->bus_info->dev, "Only UDP and TCP keys are supported\n"); mlxsw_sp 260 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c static int mlxsw_sp_flower_parse_tcp(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 273 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c dev_err(mlxsw_sp->bus_info->dev, "TCP keys supported only for TCP\n"); mlxsw_sp 281 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c dev_err(mlxsw_sp->bus_info->dev, "TCP flags match not supported on reserved bits\n"); mlxsw_sp 291 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c static int mlxsw_sp_flower_parse_ip(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 304 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c dev_err(mlxsw_sp->bus_info->dev, "IP keys supported only for IPv4/6\n"); mlxsw_sp 324 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 348 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c dev_err(mlxsw_sp->bus_info->dev, "Unsupported key\n"); mlxsw_sp 442 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_flower_parse_ports(mlxsw_sp, rulei, f, ip_proto); mlxsw_sp 445 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_flower_parse_tcp(mlxsw_sp, rulei, f, ip_proto); mlxsw_sp 449 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_flower_parse_ip(mlxsw_sp, rulei, f, n_proto_key & n_proto_mask); mlxsw_sp 453 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c return mlxsw_sp_flower_parse_actions(mlxsw_sp, block, rulei, mlxsw_sp 458 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c int mlxsw_sp_flower_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 467 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, mlxsw_sp 473 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c rule = mlxsw_sp_acl_rule_create(mlxsw_sp, ruleset, f->cookie, NULL, mlxsw_sp 481 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_flower_parse(mlxsw_sp, block, rulei, f); mlxsw_sp 489 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_acl_rule_add(mlxsw_sp, rule); mlxsw_sp 493 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); mlxsw_sp 499 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule); mlxsw_sp 501 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); mlxsw_sp 505 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c void mlxsw_sp_flower_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 512 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, mlxsw_sp 518 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, f->cookie); mlxsw_sp 520 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_rule_del(mlxsw_sp, rule); mlxsw_sp 521 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule); mlxsw_sp 524 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); mlxsw_sp 527 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c int mlxsw_sp_flower_stats(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 538 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, mlxsw_sp 544 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, f->cookie); mlxsw_sp 548 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_acl_rule_get_stats(mlxsw_sp, rule, &packets, &bytes, mlxsw_sp 555 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); mlxsw_sp 559 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); mlxsw_sp 563 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c int mlxsw_sp_flower_tmplt_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 572 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c err = mlxsw_sp_flower_parse(mlxsw_sp, block, &rulei, f); mlxsw_sp 575 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, mlxsw_sp 584 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c void mlxsw_sp_flower_tmplt_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 590 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, mlxsw_sp 596 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); mlxsw_sp 597 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); mlxsw_sp 127 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c mlxsw_sp_ipip_nexthop_update_gre4(struct mlxsw_sp *mlxsw_sp, u32 adj_index, mlxsw_sp 139 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ratr), ratr_pl); mlxsw_sp 143 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c mlxsw_sp_ipip_fib_entry_op_gre4_rtdp(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 178 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rtdp), rtdp_pl); mlxsw_sp 182 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c mlxsw_sp_ipip_fib_entry_op_gre4_ralue(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 192 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl); mlxsw_sp 195 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c static int mlxsw_sp_ipip_fib_entry_op_gre4(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 204 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c err = mlxsw_sp_ipip_fib_entry_op_gre4_rtdp(mlxsw_sp, tunnel_index, mlxsw_sp 211 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c return mlxsw_sp_ipip_fib_entry_op_gre4_ralue(mlxsw_sp, be32_to_cpu(dip), mlxsw_sp 231 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c static bool mlxsw_sp_ipip_can_offload_gre4(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 247 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c mlxsw_sp_ipip_ol_loopback_config_gre4(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 266 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c mlxsw_sp_ipip_ol_netdev_change_gre4(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 291 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c if (mlxsw_sp_ipip_demote_tunnel_by_saddr(mlxsw_sp, mlxsw_sp 295 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c mlxsw_sp_ipip_entry_demote_tunnel(mlxsw_sp, ipip_entry); mlxsw_sp 312 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c err = __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry, mlxsw_sp 316 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c err = __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry, mlxsw_sp 320 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c err = __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry, mlxsw_sp 42 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h int (*nexthop_update)(struct mlxsw_sp *mlxsw_sp, u32 adj_index, mlxsw_sp 45 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h bool (*can_offload)(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 51 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h (*ol_loopback_config)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 54 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h int (*fib_entry_op)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 59 drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h int (*ol_netdev_change)(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 15 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c int mlxsw_sp_kvdl_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 17 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c const struct mlxsw_sp_kvdl_ops *kvdl_ops = mlxsw_sp->kvdl_ops; mlxsw_sp 21 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c kvdl = kzalloc(sizeof(*mlxsw_sp->kvdl) + kvdl_ops->priv_size, mlxsw_sp 26 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c mlxsw_sp->kvdl = kvdl; mlxsw_sp 28 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c err = kvdl_ops->init(mlxsw_sp, kvdl->priv); mlxsw_sp 38 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c void mlxsw_sp_kvdl_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 40 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c struct mlxsw_sp_kvdl *kvdl = mlxsw_sp->kvdl; mlxsw_sp 42 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c kvdl->kvdl_ops->fini(mlxsw_sp, kvdl->priv); mlxsw_sp 46 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 50 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c struct mlxsw_sp_kvdl *kvdl = mlxsw_sp->kvdl; mlxsw_sp 52 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c return kvdl->kvdl_ops->alloc(mlxsw_sp, kvdl->priv, type, mlxsw_sp 56 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c void mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 60 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c struct mlxsw_sp_kvdl *kvdl = mlxsw_sp->kvdl; mlxsw_sp 62 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c kvdl->kvdl_ops->free(mlxsw_sp, kvdl->priv, type, mlxsw_sp 66 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c int mlxsw_sp_kvdl_alloc_count_query(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 71 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c struct mlxsw_sp_kvdl *kvdl = mlxsw_sp->kvdl; mlxsw_sp 73 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c return kvdl->kvdl_ops->alloc_size_query(mlxsw_sp, kvdl->priv, type, mlxsw_sp 65 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 249 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 251 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 271 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_create(mlxsw_sp, mr->priv, mlxsw_sp 277 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_update(mlxsw_sp, mr_route->route_priv, mlxsw_sp 288 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 289 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 291 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_destroy(mlxsw_sp, mr->priv, mr_route->route_priv); mlxsw_sp 412 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c dev_warn(mr_table->mlxsw_sp->bus_info->dev, mlxsw_sp 472 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 474 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 484 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_irif_update(mlxsw_sp, rve->mr_route->route_priv, mlxsw_sp 489 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_action_update(mlxsw_sp, mlxsw_sp 507 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 508 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 510 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_action_update(mlxsw_sp, rve->mr_route->route_priv, mlxsw_sp 521 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 523 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 532 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_action_update(mlxsw_sp, mlxsw_sp 542 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_erif_add(mlxsw_sp, mlxsw_sp 552 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_min_mtu_update(mlxsw_sp, mlxsw_sp 565 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_erif_del(mlxsw_sp, rve->mr_route->route_priv, mlxsw_sp 569 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_action_update(mlxsw_sp, mlxsw_sp 580 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 582 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 599 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_action_update(mlxsw_sp, mlxsw_sp 605 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_erif_del(mlxsw_sp, rve->mr_route->route_priv, rifi); mlxsw_sp 741 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 743 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 758 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_min_mtu_update(mlxsw_sp, mlxsw_sp 777 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c dev_warn(mr_table->mlxsw_sp->bus_info->dev, mlxsw_sp 824 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c dev_warn(mr_table->mlxsw_sp->bus_info->dev, mlxsw_sp 884 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr_table *mlxsw_sp_mr_table_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 898 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 909 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr_table->mlxsw_sp = mlxsw_sp; mlxsw_sp 925 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr->mr_ops->route_create(mlxsw_sp, mr->priv, mlxsw_sp 942 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp *mlxsw_sp = mr_table->mlxsw_sp; mlxsw_sp 943 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 947 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_destroy(mlxsw_sp, mr->priv, mlxsw_sp 977 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c static void mlxsw_sp_mr_route_stats_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 980 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 986 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->route_stats(mlxsw_sp, mr_route->route_priv, &packets, mlxsw_sp 1006 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mlxsw_sp_mr_route_stats_update(mr_table->mlxsw_sp, mlxsw_sp 1014 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c int mlxsw_sp_mr_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1025 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mlxsw_sp->mr = mr; mlxsw_sp 1028 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c err = mr_ops->init(mlxsw_sp, mr->priv); mlxsw_sp 1042 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c void mlxsw_sp_mr_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1044 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c struct mlxsw_sp_mr *mr = mlxsw_sp->mr; mlxsw_sp 1047 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c mr->mr_ops->fini(mlxsw_sp, mr->priv); mlxsw_sp 44 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv); mlxsw_sp 45 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_create)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 48 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 50 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_stats)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 52 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_action_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 54 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_min_mtu_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 56 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_irif_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 58 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_erif_add)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 60 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int (*route_erif_del)(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 62 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h void (*route_destroy)(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 64 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h void (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv); mlxsw_sp 70 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h int mlxsw_sp_mr_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 72 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h void mlxsw_sp_mr_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 88 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h struct mlxsw_sp_mr_table *mlxsw_sp_mr_table_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 33 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_sublist_full(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 36 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c int erif_list_entries = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 49 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_sublist_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 58 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_MCRIGR, mlxsw_sp 70 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_sublist_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 74 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_MCRIGR, mlxsw_sp 80 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 90 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c sublist = mlxsw_sp_mr_erif_sublist_create(mlxsw_sp, erif_list); mlxsw_sp 99 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c if (mlxsw_sp_mr_erif_sublist_full(mlxsw_sp, sublist)) { mlxsw_sp 100 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c sublist = mlxsw_sp_mr_erif_sublist_create(mlxsw_sp, mlxsw_sp 113 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 120 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_sublist_destroy(mlxsw_sp, erif_sublist); mlxsw_sp 124 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_commit(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 161 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rigr2), mlxsw_sp 192 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 201 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c afa_block = mlxsw_afa_block_create(mlxsw_sp->afa); mlxsw_sp 222 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_mr_erif_list_commit(mlxsw_sp, erif_list); mlxsw_sp 260 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_tcam_erif_populate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 270 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_mr_erif_list_add(mlxsw_sp, erif_list, mlxsw_sp 279 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_tcam_route_create(struct mlxsw_sp *mlxsw_sp, void *priv, mlxsw_sp 283 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 295 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_mr_tcam_erif_populate(mlxsw_sp, &route->erif_list, mlxsw_sp 301 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_flow_counter_alloc(mlxsw_sp, &route->counter_index); mlxsw_sp 306 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c route->afa_block = mlxsw_sp_mr_tcam_afa_block_create(mlxsw_sp, mlxsw_sp 324 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = ops->route_create(mlxsw_sp, mr_tcam->priv, route->priv, mlxsw_sp 336 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_flow_counter_free(mlxsw_sp, route->counter_index); mlxsw_sp 339 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); mlxsw_sp 343 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static void mlxsw_sp_mr_tcam_route_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 346 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 350 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c ops->route_destroy(mlxsw_sp, mr_tcam->priv, route->priv, &route->key); mlxsw_sp 353 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_flow_counter_free(mlxsw_sp, route->counter_index); mlxsw_sp 354 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); mlxsw_sp 357 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static int mlxsw_sp_mr_tcam_route_stats(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 363 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c return mlxsw_sp_flow_counter_get(mlxsw_sp, route->counter_index, mlxsw_sp 368 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_tcam_route_action_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 372 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 378 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c afa_block = mlxsw_sp_mr_tcam_afa_block_create(mlxsw_sp, route_action, mlxsw_sp 387 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); mlxsw_sp 401 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static int mlxsw_sp_mr_tcam_route_min_mtu_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 404 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 410 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c afa_block = mlxsw_sp_mr_tcam_afa_block_create(mlxsw_sp, mlxsw_sp 420 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); mlxsw_sp 434 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static int mlxsw_sp_mr_tcam_route_irif_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 445 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static int mlxsw_sp_mr_tcam_route_erif_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 451 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_mr_erif_list_add(mlxsw_sp, &route->erif_list, mlxsw_sp 458 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c return mlxsw_sp_mr_erif_list_commit(mlxsw_sp, mlxsw_sp 463 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static int mlxsw_sp_mr_tcam_route_erif_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 466 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 482 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_mr_erif_list_add(mlxsw_sp, &erif_list, mlxsw_sp 490 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c afa_block = mlxsw_sp_mr_tcam_afa_block_create(mlxsw_sp, route->action, mlxsw_sp 501 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); mlxsw_sp 506 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); mlxsw_sp 515 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &erif_list); mlxsw_sp 520 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_tcam_route_update(struct mlxsw_sp *mlxsw_sp, void *route_priv, mlxsw_sp 523 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 531 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = mlxsw_sp_mr_tcam_erif_populate(mlxsw_sp, &erif_list, route_info); mlxsw_sp 536 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c afa_block = mlxsw_sp_mr_tcam_afa_block_create(mlxsw_sp, mlxsw_sp 548 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); mlxsw_sp 553 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); mlxsw_sp 565 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &erif_list); mlxsw_sp 569 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static int mlxsw_sp_mr_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 571 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 575 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MC_ERIF_LIST_ENTRIES)) mlxsw_sp 582 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c err = ops->init(mlxsw_sp, mr_tcam->priv); mlxsw_sp 592 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c static void mlxsw_sp_mr_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv) mlxsw_sp 594 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c const struct mlxsw_sp_mr_tcam_ops *ops = mlxsw_sp->mr_tcam_ops; mlxsw_sp 66 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 177 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c int mlxsw_sp_nve_learned_ip_resolve(struct mlxsw_sp *mlxsw_sp, u32 uip, mlxsw_sp 192 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_find(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 195 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 202 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 205 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 228 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static void mlxsw_sp_nve_mc_list_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 231 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 240 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 245 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mc_list = mlxsw_sp_nve_mc_list_find(mlxsw_sp, key); mlxsw_sp 249 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_sp_nve_mc_list_create(mlxsw_sp, key); mlxsw_sp 253 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 258 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_destroy(mlxsw_sp, mc_list); mlxsw_sp 262 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_record_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 266 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c unsigned int num_max_entries = mlxsw_sp->nve->num_max_mc_entries[proto]; mlxsw_sp 275 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_TNUMT, 1, mlxsw_sp 281 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mc_record->mlxsw_sp = mlxsw_sp; mlxsw_sp 296 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp *mlxsw_sp = mc_record->mlxsw_sp; mlxsw_sp 299 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_TNUMT, 1, mlxsw_sp 306 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_record_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 314 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 321 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_sp_nve_mc_record_create(mlxsw_sp, mc_list, proto); mlxsw_sp 336 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mc_record->mlxsw_sp->nve; mlxsw_sp 355 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp *mlxsw_sp = mc_record->mlxsw_sp; mlxsw_sp 375 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c num_max_entries = mlxsw_sp->nve->num_max_mc_entries[mc_record->proto]; mlxsw_sp 388 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tnumt), tnumt_pl); mlxsw_sp 407 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mc_record->mlxsw_sp->nve; mlxsw_sp 544 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int mlxsw_sp_nve_mc_list_ip_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 552 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mc_record = mlxsw_sp_nve_mc_record_get(mlxsw_sp, mc_list, proto); mlxsw_sp 567 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static void mlxsw_sp_nve_mc_list_ip_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 623 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c int mlxsw_sp_nve_flood_ip_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 633 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mc_list = mlxsw_sp_nve_mc_list_get(mlxsw_sp, &key); mlxsw_sp 637 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_nve_mc_list_ip_add(mlxsw_sp, mc_list, proto, addr); mlxsw_sp 648 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_ip_del(mlxsw_sp, mc_list, proto, addr); mlxsw_sp 650 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_put(mlxsw_sp, mc_list); mlxsw_sp 654 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c void mlxsw_sp_nve_flood_ip_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 663 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mc_list = mlxsw_sp_nve_mc_list_find(mlxsw_sp, &key); mlxsw_sp 668 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_ip_del(mlxsw_sp, mc_list, proto, addr); mlxsw_sp 669 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_put(mlxsw_sp, mc_list); mlxsw_sp 675 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mc_record->mlxsw_sp->nve; mlxsw_sp 692 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static void mlxsw_sp_nve_flood_ip_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 705 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mc_list = mlxsw_sp_nve_mc_list_find(mlxsw_sp, &key); mlxsw_sp 713 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_mc_list_put(mlxsw_sp, mc_list); mlxsw_sp 716 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c u32 mlxsw_sp_nve_decap_tunnel_index_get(const struct mlxsw_sp *mlxsw_sp) mlxsw_sp 718 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c WARN_ON(mlxsw_sp->nve->num_nve_tunnels == 0); mlxsw_sp 720 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_sp->nve->tunnel_index; mlxsw_sp 723 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c bool mlxsw_sp_nve_ipv4_route_is_decap(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 726 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 737 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int mlxsw_sp_nve_tunnel_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 740 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 747 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, 1, mlxsw_sp 760 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, 1, mlxsw_sp 767 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static void mlxsw_sp_nve_tunnel_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 769 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 774 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c if (mlxsw_sp->nve->num_nve_tunnels == 1) { mlxsw_sp 776 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, 1, mlxsw_sp 783 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static void mlxsw_sp_nve_fdb_flush_by_fid(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 790 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfdf), sfdf_pl); mlxsw_sp 793 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static void mlxsw_sp_nve_fdb_clear_offload(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 804 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c ops = mlxsw_sp->nve->nve_ops_arr[type]; mlxsw_sp 808 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c int mlxsw_sp_nve_fid_enable(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *fid, mlxsw_sp 812 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp_nve *nve = mlxsw_sp->nve; mlxsw_sp 830 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_nve_tunnel_init(mlxsw_sp, &config); mlxsw_sp 854 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_tunnel_fini(mlxsw_sp); mlxsw_sp 858 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c void mlxsw_sp_nve_fid_disable(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 866 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_flood_ip_flush(mlxsw_sp, fid); mlxsw_sp 867 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_fdb_flush_by_fid(mlxsw_sp, fid_index); mlxsw_sp 877 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_fdb_clear_offload(mlxsw_sp, fid, nve_dev, vni); mlxsw_sp 884 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp_nve_tunnel_fini(mlxsw_sp); mlxsw_sp 889 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 893 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tnqdr), tnqdr_pl); mlxsw_sp 900 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int mlxsw_sp_nve_qos_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 905 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tnqcr), tnqcr_pl); mlxsw_sp 908 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int mlxsw_sp_nve_ecn_encap_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 919 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tneem), mlxsw_sp 928 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int __mlxsw_sp_nve_ecn_decap_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 940 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tndem), tndem_pl); mlxsw_sp 943 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int mlxsw_sp_nve_ecn_decap_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 955 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = __mlxsw_sp_nve_ecn_decap_init(mlxsw_sp, i, j); mlxsw_sp 964 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int mlxsw_sp_nve_ecn_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 968 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_nve_ecn_encap_init(mlxsw_sp); mlxsw_sp 972 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c return mlxsw_sp_nve_ecn_decap_init(mlxsw_sp); mlxsw_sp 975 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c static int mlxsw_sp_nve_resources_query(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 979 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_NVE_MC_ENTRIES_IPV4) || mlxsw_sp 980 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c !MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_NVE_MC_ENTRIES_IPV6)) mlxsw_sp 982 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c max = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_NVE_MC_ENTRIES_IPV4); mlxsw_sp 983 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp->nve->num_max_mc_entries[MLXSW_SP_L3_PROTO_IPV4] = max; mlxsw_sp 984 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c max = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_NVE_MC_ENTRIES_IPV6); mlxsw_sp 985 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp->nve->num_max_mc_entries[MLXSW_SP_L3_PROTO_IPV6] = max; mlxsw_sp 990 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 995 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c nve = kzalloc(sizeof(*mlxsw_sp->nve), GFP_KERNEL); mlxsw_sp 998 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp->nve = nve; mlxsw_sp 999 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c nve->mlxsw_sp = mlxsw_sp; mlxsw_sp 1000 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c nve->nve_ops_arr = mlxsw_sp->nve_ops_arr; mlxsw_sp 1007 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_nve_qos_init(mlxsw_sp); mlxsw_sp 1011 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_nve_ecn_init(mlxsw_sp); mlxsw_sp 1015 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c err = mlxsw_sp_nve_resources_query(mlxsw_sp); mlxsw_sp 1026 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp->nve = NULL; mlxsw_sp 1031 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c void mlxsw_sp_nve_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1033 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c WARN_ON(mlxsw_sp->nve->num_nve_tunnels); mlxsw_sp 1034 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c rhashtable_destroy(&mlxsw_sp->nve->mc_list_ht); mlxsw_sp 1035 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c kfree(mlxsw_sp->nve); mlxsw_sp 1036 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c mlxsw_sp->nve = NULL; mlxsw_sp 26 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h struct mlxsw_sp *mlxsw_sp; mlxsw_sp 106 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c static int __mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 113 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mprs), mprs_pl); mlxsw_sp 116 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c static int mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 119 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c int parsing_depth = mlxsw_sp->nve->inc_parsing_depth_refs ? mlxsw_sp 123 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c return __mlxsw_sp_nve_parsing_set(mlxsw_sp, parsing_depth, udp_dport); mlxsw_sp 127 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __mlxsw_sp_nve_inc_parsing_depth_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 132 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp->nve->inc_parsing_depth_refs++; mlxsw_sp 134 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp_nve_parsing_set(mlxsw_sp, udp_dport); mlxsw_sp 140 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp->nve->inc_parsing_depth_refs--; mlxsw_sp 145 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __mlxsw_sp_nve_inc_parsing_depth_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 148 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp->nve->inc_parsing_depth_refs--; mlxsw_sp 149 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp_nve_parsing_set(mlxsw_sp, udp_dport); mlxsw_sp 152 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c int mlxsw_sp_nve_inc_parsing_depth_get(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 154 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __be16 udp_dport = mlxsw_sp->nve->config.udp_dport; mlxsw_sp 156 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c return __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, udp_dport); mlxsw_sp 159 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c void mlxsw_sp_nve_inc_parsing_depth_put(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 161 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __be16 udp_dport = mlxsw_sp->nve->config.udp_dport; mlxsw_sp 163 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, udp_dport); mlxsw_sp 185 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp1_nve_vxlan_config_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 192 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp_router_tb_id_vr_id(mlxsw_sp, config->ul_tb_id, mlxsw_sp 201 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tngcr), tngcr_pl); mlxsw_sp 204 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c static void mlxsw_sp1_nve_vxlan_config_clear(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 210 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tngcr), tngcr_pl); mlxsw_sp 213 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c static int mlxsw_sp1_nve_vxlan_rtdp_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 220 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rtdp), rtdp_pl); mlxsw_sp 226 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp; mlxsw_sp 229 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, config->udp_dport); mlxsw_sp 233 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp1_nve_vxlan_config_set(mlxsw_sp, config); mlxsw_sp 237 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp1_nve_vxlan_rtdp_set(mlxsw_sp, nve->tunnel_index); mlxsw_sp 241 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp_router_nve_promote_decap(mlxsw_sp, config->ul_tb_id, mlxsw_sp 252 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp); mlxsw_sp 254 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0); mlxsw_sp 261 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp; mlxsw_sp 263 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id, mlxsw_sp 265 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp); mlxsw_sp 266 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0); mlxsw_sp 297 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c static bool mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 304 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tnpc), tnpc_pl); mlxsw_sp 308 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp2_nve_vxlan_config_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 315 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp_router_ul_rif_get(mlxsw_sp, config->ul_tb_id, mlxsw_sp 319 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp->nve->ul_rif_index = ul_rif_index; mlxsw_sp 321 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp2_nve_vxlan_learning_set(mlxsw_sp, config->learning_en); mlxsw_sp 328 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tngcr), tngcr_pl); mlxsw_sp 335 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp2_nve_vxlan_learning_set(mlxsw_sp, false); mlxsw_sp 337 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp_router_ul_rif_put(mlxsw_sp, ul_rif_index); mlxsw_sp 341 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c static void mlxsw_sp2_nve_vxlan_config_clear(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 346 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tngcr), tngcr_pl); mlxsw_sp 347 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp2_nve_vxlan_learning_set(mlxsw_sp, false); mlxsw_sp 348 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp_router_ul_rif_put(mlxsw_sp, mlxsw_sp->nve->ul_rif_index); mlxsw_sp 351 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c static int mlxsw_sp2_nve_vxlan_rtdp_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 360 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rtdp), rtdp_pl); mlxsw_sp 366 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp; mlxsw_sp 369 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, config->udp_dport); mlxsw_sp 373 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp2_nve_vxlan_config_set(mlxsw_sp, config); mlxsw_sp 377 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp2_nve_vxlan_rtdp_set(mlxsw_sp, nve->tunnel_index, mlxsw_sp 382 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c err = mlxsw_sp_router_nve_promote_decap(mlxsw_sp, config->ul_tb_id, mlxsw_sp 393 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp); mlxsw_sp 395 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0); mlxsw_sp 402 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp; mlxsw_sp 404 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id, mlxsw_sp 406 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp); mlxsw_sp 407 drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0); mlxsw_sp 31 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 251 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) mlxsw_sp 268 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c clock->core = mlxsw_sp->core; mlxsw_sp 363 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_unmatched_save(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 369 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c struct mlxsw_sp_ptp_state *ptp_state = mlxsw_sp->ptp_state; mlxsw_sp 380 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c unmatched->gc_cycle = mlxsw_sp->ptp_state->gc_cycle + cycles; mlxsw_sp 391 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_unmatched_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 398 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c list = rhltable_lookup(&mlxsw_sp->ptp_state->unmatched_ht, &key, mlxsw_sp 410 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_unmatched_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 413 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c return rhltable_remove(&mlxsw_sp->ptp_state->unmatched_ht, mlxsw_sp 426 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static void mlxsw_sp1_ptp_packet_finish(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 437 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 446 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_rx_listener_no_mark_func(skb, local_port, mlxsw_sp); mlxsw_sp 454 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static void mlxsw_sp1_packet_timestamp(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 462 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c spin_lock_bh(&mlxsw_sp->clock->lock); mlxsw_sp 463 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c nsec = timecounter_cyc2time(&mlxsw_sp->clock->tc, timestamp); mlxsw_sp 464 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c spin_unlock_bh(&mlxsw_sp->clock->lock); mlxsw_sp 467 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_packet_finish(mlxsw_sp, skb, mlxsw_sp 472 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_unmatched_finish(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 476 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_packet_timestamp(mlxsw_sp, unmatched->key, mlxsw_sp 480 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_packet_finish(mlxsw_sp, unmatched->skb, mlxsw_sp 498 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static void mlxsw_sp1_ptp_got_piece(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 508 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c spin_lock(&mlxsw_sp->ptp_state->unmatched_lock); mlxsw_sp 510 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c unmatched = mlxsw_sp1_ptp_unmatched_lookup(mlxsw_sp, key, &length); mlxsw_sp 520 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_sp1_ptp_unmatched_save(mlxsw_sp, key, mlxsw_sp 525 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_packet_finish(mlxsw_sp, skb, mlxsw_sp 532 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_sp1_ptp_unmatched_remove(mlxsw_sp, unmatched); mlxsw_sp 536 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c spin_unlock(&mlxsw_sp->ptp_state->unmatched_lock); mlxsw_sp 539 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_unmatched_finish(mlxsw_sp, unmatched); mlxsw_sp 544 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static void mlxsw_sp1_ptp_got_packet(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 553 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 577 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_got_piece(mlxsw_sp, key, skb, 0); mlxsw_sp 581 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_packet_finish(mlxsw_sp, skb, local_port, ingress, NULL); mlxsw_sp 584 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c void mlxsw_sp1_ptp_got_timestamp(struct mlxsw_sp *mlxsw_sp, bool ingress, mlxsw_sp 593 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 613 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_got_piece(mlxsw_sp, key, NULL, timestamp); mlxsw_sp 616 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c void mlxsw_sp1_ptp_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, mlxsw_sp 620 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_got_packet(mlxsw_sp, skb, local_port, true); mlxsw_sp 623 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c void mlxsw_sp1_ptp_transmitted(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 626 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_got_packet(mlxsw_sp, skb, local_port, false); mlxsw_sp 655 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_port = ptp_state->mlxsw_sp->ports[unmatched->key.local_port]; mlxsw_sp 672 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_unmatched_finish(ptp_state->mlxsw_sp, unmatched); mlxsw_sp 707 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static int mlxsw_sp_ptp_mtptpt_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 714 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mtptpt), mtptpt_pl); mlxsw_sp 717 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static int mlxsw_sp1_ptp_set_fifo_clr_on_trap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 723 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(mogcr), mogcr_pl); mlxsw_sp 729 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mogcr), mogcr_pl); mlxsw_sp 732 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static int mlxsw_sp1_ptp_mtpppc_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 738 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mtpppc), mtpppc_pl); mlxsw_sp 803 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c static int mlxsw_sp1_ptp_shaper_params_set(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 818 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qpsc), qpsc_pl); mlxsw_sp 826 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c struct mlxsw_sp_ptp_state *mlxsw_sp1_ptp_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 832 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_sp1_ptp_shaper_params_set(mlxsw_sp); mlxsw_sp 839 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c ptp_state->mlxsw_sp = mlxsw_sp; mlxsw_sp 853 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_sp_ptp_mtptpt_set(mlxsw_sp, MLXSW_REG_MTPTPT_TRAP_ID_PTP0, mlxsw_sp 860 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_sp_ptp_mtptpt_set(mlxsw_sp, MLXSW_REG_MTPTPT_TRAP_ID_PTP1, mlxsw_sp 865 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_sp1_ptp_set_fifo_clr_on_trap(mlxsw_sp, true); mlxsw_sp 875 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_ptp_mtptpt_set(mlxsw_sp, MLXSW_REG_MTPTPT_TRAP_ID_PTP1, 0); mlxsw_sp 877 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_ptp_mtptpt_set(mlxsw_sp, MLXSW_REG_MTPTPT_TRAP_ID_PTP0, 0); mlxsw_sp 887 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c struct mlxsw_sp *mlxsw_sp = ptp_state->mlxsw_sp; mlxsw_sp 890 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_mtpppc_set(mlxsw_sp, 0, 0); mlxsw_sp 891 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp1_ptp_set_fifo_clr_on_trap(mlxsw_sp, false); mlxsw_sp 892 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_ptp_mtptpt_set(mlxsw_sp, MLXSW_REG_MTPTPT_TRAP_ID_PTP1, 0); mlxsw_sp 893 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_ptp_mtptpt_set(mlxsw_sp, MLXSW_REG_MTPTPT_TRAP_ID_PTP0, 0); mlxsw_sp 965 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 975 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c for (i = 1; i < mlxsw_core_max_ports(mlxsw_sp->core); i++) { mlxsw_sp 976 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c tmp = mlxsw_sp->ports[i]; mlxsw_sp 988 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp); mlxsw_sp 995 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp); mlxsw_sp 997 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c return mlxsw_sp1_ptp_mtpppc_set(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 1009 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1013 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl); mlxsw_sp 1019 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1028 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c port_type_speed_ops = mlxsw_sp->port_type_speed_ops; mlxsw_sp 1029 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c port_type_speed_ops->reg_ptys_eth_pack(mlxsw_sp, ptys_pl, mlxsw_sp 1032 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ptys), ptys_pl); mlxsw_sp 1035 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c port_type_speed_ops->reg_ptys_eth_unpack(mlxsw_sp, ptys_pl, NULL, NULL, mlxsw_sp 1038 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c speed = port_type_speed_ops->from_ptys_speed(mlxsw_sp, eth_proto_oper); mlxsw_sp 1097 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1100 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c info->phc_index = ptp_clock_index(mlxsw_sp->clock->ptp); mlxsw_sp 10 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h struct mlxsw_sp; mlxsw_sp 32 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp1_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev); mlxsw_sp 36 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h struct mlxsw_sp_ptp_state *mlxsw_sp1_ptp_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 40 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h void mlxsw_sp1_ptp_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, mlxsw_sp 43 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h void mlxsw_sp1_ptp_transmitted(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 46 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h void mlxsw_sp1_ptp_got_timestamp(struct mlxsw_sp *mlxsw_sp, bool ingress, mlxsw_sp 59 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 70 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp1_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) mlxsw_sp 80 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp1_ptp_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 89 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h static inline void mlxsw_sp1_ptp_receive(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 92 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp_rx_listener_no_mark_func(skb, local_port, mlxsw_sp); mlxsw_sp 95 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h static inline void mlxsw_sp1_ptp_transmitted(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 102 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp1_ptp_got_timestamp(struct mlxsw_sp *mlxsw_sp, bool ingress, mlxsw_sp 127 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h static inline int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 149 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp2_ptp_clock_init(struct mlxsw_sp *mlxsw_sp, struct device *dev) mlxsw_sp 159 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp2_ptp_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 168 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h static inline void mlxsw_sp2_ptp_receive(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 171 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h mlxsw_sp_rx_listener_no_mark_func(skb, local_port, mlxsw_sp); mlxsw_sp 174 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h static inline void mlxsw_sp2_ptp_transmitted(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 198 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h static inline int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 236 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 245 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(cwtp), cwtp_cmd); mlxsw_sp 252 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(cwtpm), cwtpm_cmd); mlxsw_sp 259 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 264 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(cwtpm), cwtpm_cmd); mlxsw_sp 313 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 317 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c dev_err(mlxsw_sp->bus_info->dev, mlxsw_sp 322 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c if (p->max > MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_BUFFER_SIZE)) { mlxsw_sp 323 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c dev_err(mlxsw_sp->bus_info->dev, mlxsw_sp 328 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c dev_err(mlxsw_sp->bus_info->dev, mlxsw_sp 340 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 351 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c min = mlxsw_sp_bytes_cells(mlxsw_sp, p->min); mlxsw_sp 352 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c max = mlxsw_sp_bytes_cells(mlxsw_sp, p->max); mlxsw_sp 365 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c backlog = mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 429 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 431 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 570 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c backlog = mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 603 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 605 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 51 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 91 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 147 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_lpm_tree_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 149 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_vr_lpm_tree_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 152 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_vr_lpm_tree_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 196 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_rif_counter_edit(struct mlxsw_sp *mlxsw_sp, u16 rif_index, mlxsw_sp 207 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 213 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 216 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_rif_counter_value_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 234 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ricnt), ricnt_pl); mlxsw_sp 241 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_rif_counter_clear(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 248 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ricnt), ricnt_pl); mlxsw_sp 251 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_rif_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 261 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_counter_alloc(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_RIF, mlxsw_sp 266 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_counter_clear(mlxsw_sp, *p_counter_index); mlxsw_sp 270 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_counter_edit(mlxsw_sp, rif->rif_index, mlxsw_sp 279 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_counter_free(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_RIF, mlxsw_sp 284 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_rif_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 296 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_counter_edit(mlxsw_sp, rif->rif_index, mlxsw_sp 298 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_counter_free(mlxsw_sp, MLXSW_SP_COUNTER_SUB_POOL_RIF, mlxsw_sp 305 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 308 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 312 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_counter_alloc(mlxsw_sp, rif, MLXSW_SP_RIF_COUNTER_EGRESS); mlxsw_sp 317 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 319 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_counter_free(mlxsw_sp, rif, MLXSW_SP_RIF_COUNTER_EGRESS); mlxsw_sp 452 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static struct mlxsw_sp_fib *mlxsw_sp_fib_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 460 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp->router->lpm.proto_trees[proto]; mlxsw_sp 472 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, lpm_tree->id); mlxsw_sp 478 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree); mlxsw_sp 484 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 487 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_lpm_tree_unbind(mlxsw_sp, fib); mlxsw_sp 488 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, fib->lpm_tree); mlxsw_sp 495 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_find_unused(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 500 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { mlxsw_sp 501 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = &mlxsw_sp->router->lpm.trees[i]; mlxsw_sp 508 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_lpm_tree_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 516 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl); mlxsw_sp 519 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_lpm_tree_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 527 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl); mlxsw_sp 531 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_left_struct_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 551 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralst), ralst_pl); mlxsw_sp 555 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 562 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp_lpm_tree_find_unused(mlxsw_sp); mlxsw_sp 566 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_lpm_tree_alloc(mlxsw_sp, lpm_tree); mlxsw_sp 570 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_lpm_tree_left_struct_set(mlxsw_sp, prefix_usage, mlxsw_sp 582 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_free(mlxsw_sp, lpm_tree); mlxsw_sp 586 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_lpm_tree_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 589 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_free(mlxsw_sp, lpm_tree); mlxsw_sp 593 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 600 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { mlxsw_sp 601 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = &mlxsw_sp->router->lpm.trees[i]; mlxsw_sp 610 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_lpm_tree_create(mlxsw_sp, prefix_usage, proto); mlxsw_sp 618 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_lpm_tree_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 622 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_destroy(mlxsw_sp, lpm_tree); mlxsw_sp 627 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_lpm_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 634 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_LPM_TREES)) mlxsw_sp 637 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c max_trees = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_LPM_TREES); mlxsw_sp 638 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->lpm.tree_count = max_trees - MLXSW_SP_LPM_TREE_MIN; mlxsw_sp 639 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->lpm.trees = kcalloc(mlxsw_sp->router->lpm.tree_count, mlxsw_sp 642 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp->router->lpm.trees) mlxsw_sp 645 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < mlxsw_sp->router->lpm.tree_count; i++) { mlxsw_sp 646 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = &mlxsw_sp->router->lpm.trees[i]; mlxsw_sp 650 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp_lpm_tree_get(mlxsw_sp, &req_prefix_usage, mlxsw_sp 656 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4] = lpm_tree; mlxsw_sp 658 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp_lpm_tree_get(mlxsw_sp, &req_prefix_usage, mlxsw_sp 664 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV6] = lpm_tree; mlxsw_sp 669 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4]; mlxsw_sp 670 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree); mlxsw_sp 672 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c kfree(mlxsw_sp->router->lpm.trees); mlxsw_sp 676 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_lpm_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 680 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV6]; mlxsw_sp 681 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree); mlxsw_sp 683 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp->router->lpm.proto_trees[MLXSW_SP_L3_PROTO_IPV4]; mlxsw_sp 684 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree); mlxsw_sp 686 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c kfree(mlxsw_sp->router->lpm.trees); mlxsw_sp 696 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static struct mlxsw_sp_vr *mlxsw_sp_vr_find_unused(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 701 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); i++) { mlxsw_sp 702 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = &mlxsw_sp->router->vrs[i]; mlxsw_sp 709 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_vr_lpm_tree_bind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 717 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(raltb), raltb_pl); mlxsw_sp 720 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_vr_lpm_tree_unbind(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 728 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(raltb), raltb_pl); mlxsw_sp 739 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static struct mlxsw_sp_vr *mlxsw_sp_vr_find(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 747 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); i++) { mlxsw_sp 748 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = &mlxsw_sp->router->vrs[i]; mlxsw_sp 755 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_router_tb_id_vr_id(struct mlxsw_sp *mlxsw_sp, u32 tb_id, mlxsw_sp 760 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find(mlxsw_sp, tb_id); mlxsw_sp 780 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static struct mlxsw_sp_vr *mlxsw_sp_vr_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 790 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find_unused(mlxsw_sp); mlxsw_sp 795 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib4 = mlxsw_sp_fib_create(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV4); mlxsw_sp 798 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib6 = mlxsw_sp_fib_create(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV6); mlxsw_sp 803 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mr4_table = mlxsw_sp_mr_table_create(mlxsw_sp, vr->id, mlxsw_sp 809 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mr6_table = mlxsw_sp_mr_table_create(mlxsw_sp, vr->id, mlxsw_sp 826 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_destroy(mlxsw_sp, fib6); mlxsw_sp 828 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_destroy(mlxsw_sp, fib4); mlxsw_sp 832 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_vr_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 839 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_destroy(mlxsw_sp, vr->fib6); mlxsw_sp 841 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_destroy(mlxsw_sp, vr->fib4); mlxsw_sp 845 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static struct mlxsw_sp_vr *mlxsw_sp_vr_get(struct mlxsw_sp *mlxsw_sp, u32 tb_id, mlxsw_sp 851 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find(mlxsw_sp, tb_id); mlxsw_sp 853 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_create(mlxsw_sp, tb_id, extack); mlxsw_sp 857 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_vr_put(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_vr *vr) mlxsw_sp 863 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_destroy(mlxsw_sp, vr); mlxsw_sp 879 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_vr_lpm_tree_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 888 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, new_tree->id); mlxsw_sp 891 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, old_tree); mlxsw_sp 895 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, new_tree); mlxsw_sp 900 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_vrs_lpm_tree_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 910 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c old_tree = mlxsw_sp->router->lpm.proto_trees[proto]; mlxsw_sp 913 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); i++) { mlxsw_sp 914 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = &mlxsw_sp->router->vrs[i]; mlxsw_sp 917 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_vr_lpm_tree_replace(mlxsw_sp, mlxsw_sp 926 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->lpm.proto_trees[proto] = new_tree; mlxsw_sp 927 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, old_tree); mlxsw_sp 935 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_lpm_tree_replace(mlxsw_sp, mlxsw_sp 942 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_vrs_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 948 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_VRS)) mlxsw_sp 951 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c max_vrs = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); mlxsw_sp 952 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->vrs = kcalloc(max_vrs, sizeof(struct mlxsw_sp_vr), mlxsw_sp 954 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp->router->vrs) mlxsw_sp 958 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = &mlxsw_sp->router->vrs[i]; mlxsw_sp 965 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_fib_flush(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 967 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_vrs_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 977 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_flush(mlxsw_sp); mlxsw_sp 978 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c kfree(mlxsw_sp->router->vrs); mlxsw_sp 1001 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1006 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_ol_ipip_lb_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1015 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; mlxsw_sp 1019 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c .lb_config = ipip_ops->ol_loopback_config(mlxsw_sp, ol_dev), mlxsw_sp 1022 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_create(mlxsw_sp, &lb_params.common, extack); mlxsw_sp 1029 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1037 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipipt]; mlxsw_sp 1042 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry->ol_lb = mlxsw_sp_ipip_ol_ipip_lb_create(mlxsw_sp, ipipt, mlxsw_sp 1076 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_saddr_matches(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1086 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto) mlxsw_sp 1095 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_decap_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1102 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, mlxsw_sp 1113 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib_entry_decap_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1119 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, mlxsw_sp 1126 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1130 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_demote_decap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1135 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_decap_fini(mlxsw_sp, fib_entry); mlxsw_sp 1138 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); mlxsw_sp 1142 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_promote_decap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1146 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_fib_entry_decap_init(mlxsw_sp, decap_fib_entry, mlxsw_sp 1151 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_fib_entry_update(mlxsw_sp, decap_fib_entry)) mlxsw_sp 1152 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_demote_decap(mlxsw_sp, ipip_entry); mlxsw_sp 1156 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_ip2me_fib_entry_find(struct mlxsw_sp *mlxsw_sp, u32 tb_id, mlxsw_sp 1170 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find(mlxsw_sp, tb_id); mlxsw_sp 1203 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_find_decap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1218 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; mlxsw_sp 1221 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_vr = mlxsw_sp_vr_find(mlxsw_sp, ul_tb_id); mlxsw_sp 1255 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1261 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_alloc(mlxsw_sp, ipipt, ol_dev); mlxsw_sp 1266 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c &mlxsw_sp->router->ipip_list); mlxsw_sp 1272 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1280 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_matches_decap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1289 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto) mlxsw_sp 1292 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_ipip_entry_saddr_matches(mlxsw_sp, ul_proto, ul_dip, mlxsw_sp 1298 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_find_by_decap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1305 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_for_each_entry(ipip_entry, &mlxsw_sp->router->ipip_list, mlxsw_sp 1307 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_ipip_entry_matches_decap(mlxsw_sp, ul_dev, mlxsw_sp 1315 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static bool mlxsw_sp_netdev_ipip_type(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1319 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp_router *router = mlxsw_sp->router; mlxsw_sp 1334 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c bool mlxsw_sp_netdev_is_ipip_ol(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1337 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdev_ipip_type(mlxsw_sp, dev, NULL); mlxsw_sp 1341 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_find_by_ol_dev(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1346 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_for_each_entry(ipip_entry, &mlxsw_sp->router->ipip_list, mlxsw_sp 1355 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_find_by_ul_dev(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1361 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = list_prepare_entry(start, &mlxsw_sp->router->ipip_list, mlxsw_sp 1363 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_for_each_entry_continue(ipip_entry, &mlxsw_sp->router->ipip_list, mlxsw_sp 1375 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c bool mlxsw_sp_netdev_is_ipip_ul(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1378 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_ipip_entry_find_by_ul_dev(mlxsw_sp, dev, NULL); mlxsw_sp 1381 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static bool mlxsw_sp_netdevice_ipip_can_offload(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1386 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c = mlxsw_sp->router->ipip_ops_arr[ipipt]; mlxsw_sp 1391 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return ops->can_offload(mlxsw_sp, ol_dev, MLXSW_SP_L3_PROTO_IPV4) || mlxsw_sp 1392 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ops->can_offload(mlxsw_sp, ol_dev, MLXSW_SP_L3_PROTO_IPV6); mlxsw_sp 1395 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_netdevice_ipip_ol_reg_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1404 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdev_ipip_type(mlxsw_sp, ol_dev, &ipipt); mlxsw_sp 1405 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_netdevice_ipip_can_offload(mlxsw_sp, ol_dev, ipipt)) { mlxsw_sp 1407 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_proto = mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto; mlxsw_sp 1409 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp_ipip_demote_tunnel_by_saddr(mlxsw_sp, ul_proto, mlxsw_sp 1412 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_create(mlxsw_sp, ipipt, mlxsw_sp 1422 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_netdevice_ipip_ol_unreg_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1427 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev); mlxsw_sp 1429 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_destroy(mlxsw_sp, ipip_entry); mlxsw_sp 1433 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_ol_up_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1438 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c decap_fib_entry = mlxsw_sp_ipip_entry_find_decap(mlxsw_sp, ipip_entry); mlxsw_sp 1440 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_promote_decap(mlxsw_sp, ipip_entry, mlxsw_sp 1450 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 1468 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 1471 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_netdevice_ipip_ol_update_mtu(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1478 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev); mlxsw_sp 1492 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_netdevice_ipip_ol_up_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1497 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev); mlxsw_sp 1499 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_ol_up_event(mlxsw_sp, ipip_entry); mlxsw_sp 1503 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_ol_down_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1507 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_demote_decap(mlxsw_sp, ipip_entry); mlxsw_sp 1510 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_netdevice_ipip_ol_down_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1515 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev); mlxsw_sp 1517 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_ol_down_event(mlxsw_sp, ipip_entry); mlxsw_sp 1520 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_rif_migrate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1524 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_ol_lb_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1532 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c new_lb_rif = mlxsw_sp_ipip_ol_ipip_lb_create(mlxsw_sp, mlxsw_sp 1541 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_rif_migrate(mlxsw_sp, &old_lb_rif->common, mlxsw_sp 1549 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_rif_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1561 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int __mlxsw_sp_ipip_entry_update_tunnel(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1577 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_demote_decap(mlxsw_sp, ipip_entry); mlxsw_sp 1580 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_ipip_entry_ol_lb_update(mlxsw_sp, ipip_entry, mlxsw_sp 1585 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_rif_update(mlxsw_sp, mlxsw_sp 1590 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_ol_up_event(mlxsw_sp, ipip_entry); mlxsw_sp 1595 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_netdevice_ipip_ol_vrf_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1600 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev); mlxsw_sp 1605 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry, mlxsw_sp 1610 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ul_vrf_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1615 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry, mlxsw_sp 1620 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ul_up_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1624 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry, mlxsw_sp 1629 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ul_down_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1637 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry, mlxsw_sp 1642 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ol_change_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1650 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev); mlxsw_sp 1659 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp_netdevice_ipip_can_offload(mlxsw_sp, ol_dev, mlxsw_sp 1661 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_demote_tunnel(mlxsw_sp, ipip_entry); mlxsw_sp 1665 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; mlxsw_sp 1666 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = ipip_ops->ol_netdev_change(mlxsw_sp, ipip_entry, extack); mlxsw_sp 1670 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_ipip_entry_demote_tunnel(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1676 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_ol_down_event(mlxsw_sp, ipip_entry); mlxsw_sp 1677 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_destroy(mlxsw_sp, ipip_entry); mlxsw_sp 1687 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_demote_tunnel_by_saddr(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1695 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_for_each_entry_safe(ipip_entry, tmp, &mlxsw_sp->router->ipip_list, mlxsw_sp 1698 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_saddr_matches(mlxsw_sp, ul_proto, saddr, mlxsw_sp 1700 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_demote_tunnel(mlxsw_sp, ipip_entry); mlxsw_sp 1708 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_ipip_demote_tunnel_by_ul_netdev(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1713 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_for_each_entry_safe(ipip_entry, tmp, &mlxsw_sp->router->ipip_list, mlxsw_sp 1719 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_entry_demote_tunnel(mlxsw_sp, ipip_entry); mlxsw_sp 1723 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_netdevice_ipip_ol_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1733 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdevice_ipip_ol_reg_event(mlxsw_sp, ol_dev); mlxsw_sp 1735 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ol_unreg_event(mlxsw_sp, ol_dev); mlxsw_sp 1738 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ol_up_event(mlxsw_sp, ol_dev); mlxsw_sp 1741 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ol_down_event(mlxsw_sp, ol_dev); mlxsw_sp 1747 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdevice_ipip_ol_vrf_event(mlxsw_sp, mlxsw_sp 1753 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdevice_ipip_ol_change_event(mlxsw_sp, mlxsw_sp 1756 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdevice_ipip_ol_update_mtu(mlxsw_sp, ol_dev); mlxsw_sp 1762 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_netdevice_ipip_ul_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1776 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdevice_ipip_ul_vrf_event(mlxsw_sp, mlxsw_sp 1783 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdevice_ipip_ul_up_event(mlxsw_sp, ipip_entry, mlxsw_sp 1786 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_netdevice_ipip_ul_down_event(mlxsw_sp, mlxsw_sp 1794 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdevice_ipip_ul_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1802 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c while ((ipip_entry = mlxsw_sp_ipip_entry_find_by_ul_dev(mlxsw_sp, mlxsw_sp 1805 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_netdevice_ipip_ul_event(mlxsw_sp, ipip_entry, mlxsw_sp 1808 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_demote_tunnel_by_ul_netdev(mlxsw_sp, mlxsw_sp 1817 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_router_nve_promote_decap(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id, mlxsw_sp 1829 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib_entry = mlxsw_sp_router_ip2me_fib_entry_find(mlxsw_sp, ul_tb_id, mlxsw_sp 1838 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); mlxsw_sp 1846 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); mlxsw_sp 1850 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_router_nve_demote_decap(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id, mlxsw_sp 1857 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib_entry = mlxsw_sp_router_ip2me_fib_entry_find(mlxsw_sp, ul_tb_id, mlxsw_sp 1864 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); mlxsw_sp 1937 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_neigh_counter_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1944 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_flow_counter_get(mlxsw_sp, neigh_entry->counter_index, mlxsw_sp 1949 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_alloc(struct mlxsw_sp *mlxsw_sp, struct neighbour *n, mlxsw_sp 1971 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_insert(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1974 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return rhashtable_insert_fast(&mlxsw_sp->router->neigh_ht, mlxsw_sp 1980 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1983 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_remove_fast(&mlxsw_sp->router->neigh_ht, mlxsw_sp 1989 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_counter_should_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2007 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 2012 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2015 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp_neigh_counter_should_alloc(mlxsw_sp, neigh_entry)) mlxsw_sp 2018 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_flow_counter_alloc(mlxsw_sp, &neigh_entry->counter_index)) mlxsw_sp 2025 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2030 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_flow_counter_free(mlxsw_sp, mlxsw_sp 2036 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_create(struct mlxsw_sp *mlxsw_sp, struct neighbour *n) mlxsw_sp 2042 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, n->dev); mlxsw_sp 2046 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c neigh_entry = mlxsw_sp_neigh_entry_alloc(mlxsw_sp, n, rif->rif_index); mlxsw_sp 2050 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry); mlxsw_sp 2054 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_counter_alloc(mlxsw_sp, neigh_entry); mlxsw_sp 2065 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2069 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_counter_free(mlxsw_sp, neigh_entry); mlxsw_sp 2070 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_remove(mlxsw_sp, neigh_entry); mlxsw_sp 2075 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_lookup(struct mlxsw_sp *mlxsw_sp, struct neighbour *n) mlxsw_sp 2080 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return rhashtable_lookup_fast(&mlxsw_sp->router->neigh_ht, mlxsw_sp 2085 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neighs_update_interval_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 2096 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->neighs_update.interval = jiffies_to_msecs(interval); mlxsw_sp 2099 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_neigh_ent_ipv4_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2111 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp->router->rifs[rif]) { mlxsw_sp 2112 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Incorrect RIF in neighbour entry\n"); mlxsw_sp 2117 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev = mlxsw_sp->router->rifs[rif]->dev; mlxsw_sp 2128 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_neigh_ent_ipv6_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2140 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp->router->rifs[rif]) { mlxsw_sp 2141 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Incorrect RIF in neighbour entry\n"); mlxsw_sp 2145 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev = mlxsw_sp->router->rifs[rif]->dev; mlxsw_sp 2155 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_neigh_ent_ipv6_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2162 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_neigh_rec_ipv4_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2179 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neigh_ent_ipv4_process(mlxsw_sp, rauhtd_pl, mlxsw_sp 2185 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_neigh_rec_ipv6_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2190 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neigh_ent_ipv6_process(mlxsw_sp, rauhtd_pl, mlxsw_sp 2194 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_neigh_rec_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2199 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neigh_rec_ipv4_process(mlxsw_sp, rauhtd_pl, mlxsw_sp 2203 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neigh_rec_ipv6_process(mlxsw_sp, rauhtd_pl, mlxsw_sp 2230 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_router_neighs_update_rauhtd(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2243 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(rauhtd), mlxsw_sp 2246 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to dump neighbour table\n"); mlxsw_sp 2251 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neigh_rec_process(mlxsw_sp, rauhtd_pl, mlxsw_sp 2259 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_router_neighs_update_rauhtd(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 2270 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_router_neighs_update_rauhtd(mlxsw_sp, rauhtd_pl, type); mlxsw_sp 2275 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_router_neighs_update_rauhtd(mlxsw_sp, rauhtd_pl, type); mlxsw_sp 2281 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_neighs_update_nh(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 2287 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_for_each_entry(neigh_entry, &mlxsw_sp->router->nexthop_neighs_list, mlxsw_sp 2297 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neighs_update_work_schedule(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 2299 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c unsigned long interval = mlxsw_sp->router->neighs_update.interval; mlxsw_sp 2301 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_core_schedule_dw(&mlxsw_sp->router->neighs_update.dw, mlxsw_sp 2312 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_neighs_update_rauhtd(router->mlxsw_sp); mlxsw_sp 2314 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_err(router->mlxsw_sp->bus_info->dev, "Could not update kernel for neigh activity"); mlxsw_sp 2316 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neighs_update_nh(router->mlxsw_sp); mlxsw_sp 2318 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neighs_update_work_schedule(router->mlxsw_sp); mlxsw_sp 2348 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2359 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neigh_entry_op4(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2372 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl); mlxsw_sp 2376 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neigh_entry_op6(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2389 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl); mlxsw_sp 2407 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2418 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_neigh_entry_op4(mlxsw_sp, neigh_entry, mlxsw_sp 2425 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_neigh_entry_op6(mlxsw_sp, neigh_entry, mlxsw_sp 2441 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_counter_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2446 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_counter_alloc(mlxsw_sp, neigh_entry); mlxsw_sp 2448 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_counter_free(mlxsw_sp, neigh_entry); mlxsw_sp 2449 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, true); mlxsw_sp 2454 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 2462 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = net_work->mlxsw_sp; mlxsw_sp 2480 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_span_respin(mlxsw_sp); mlxsw_sp 2483 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c neigh_entry = mlxsw_sp_neigh_entry_lookup(mlxsw_sp, n); mlxsw_sp 2487 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c neigh_entry = mlxsw_sp_neigh_entry_create(mlxsw_sp, n); mlxsw_sp 2493 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, entry_connected); mlxsw_sp 2494 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_neigh_update(mlxsw_sp, neigh_entry, !entry_connected, mlxsw_sp 2498 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); mlxsw_sp 2506 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_mp_hash_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 2512 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = net_work->mlxsw_sp; mlxsw_sp 2514 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_mp_hash_init(mlxsw_sp); mlxsw_sp 2518 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int __mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 2524 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = net_work->mlxsw_sp; mlxsw_sp 2526 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_router_init(mlxsw_sp); mlxsw_sp 2546 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c net_work->mlxsw_sp = router->mlxsw_sp; mlxsw_sp 2556 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 2577 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 2579 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->neighs_update.interval = interval; mlxsw_sp 2600 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c net_work->mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 2624 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_neigh_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 2628 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = rhashtable_init(&mlxsw_sp->router->neigh_ht, mlxsw_sp 2636 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_neighs_update_interval_init(mlxsw_sp); mlxsw_sp 2639 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c INIT_DELAYED_WORK(&mlxsw_sp->router->neighs_update.dw, mlxsw_sp 2641 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c INIT_DELAYED_WORK(&mlxsw_sp->router->nexthop_probe_dw, mlxsw_sp 2643 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_core_schedule_dw(&mlxsw_sp->router->neighs_update.dw, 0); mlxsw_sp 2644 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_core_schedule_dw(&mlxsw_sp->router->nexthop_probe_dw, 0); mlxsw_sp 2648 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_neigh_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 2650 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c cancel_delayed_work_sync(&mlxsw_sp->router->neighs_update.dw); mlxsw_sp 2651 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c cancel_delayed_work_sync(&mlxsw_sp->router->nexthop_probe_dw); mlxsw_sp 2652 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_destroy(&mlxsw_sp->router->neigh_ht); mlxsw_sp 2655 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_neigh_rif_gone_sync(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2662 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, false); mlxsw_sp 2663 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); mlxsw_sp 2724 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2729 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 2734 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_flow_counter_alloc(mlxsw_sp, &nh->counter_index)) mlxsw_sp 2740 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_nexthop_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2745 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_flow_counter_free(mlxsw_sp, nh->counter_index); mlxsw_sp 2749 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_nexthop_counter_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2755 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_flow_counter_get(mlxsw_sp, nh->counter_index, mlxsw_sp 2976 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop_group_insert(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2983 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return rhashtable_insert_fast(&mlxsw_sp->router->nexthop_group_ht, mlxsw_sp 2988 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_group_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2995 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_remove_fast(&mlxsw_sp->router->nexthop_group_ht, mlxsw_sp 3001 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_group_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3008 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, mlxsw_sp 3014 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3021 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_group_ht, mlxsw_sp 3032 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop_insert(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3035 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return rhashtable_insert_fast(&mlxsw_sp->router->nexthop_ht, mlxsw_sp 3039 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_remove(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3042 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_remove_fast(&mlxsw_sp->router->nexthop_ht, &nh->ht_node, mlxsw_sp 3047 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3050 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return rhashtable_lookup_fast(&mlxsw_sp->router->nexthop_ht, &key, mlxsw_sp 3054 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_adj_index_mass_update_vr(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3066 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(raleu), raleu_pl); mlxsw_sp 3069 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_adj_index_mass_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3081 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_adj_index_mass_update_vr(mlxsw_sp, fib, mlxsw_sp 3092 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int __mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, mlxsw_sp 3107 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ratr), ratr_pl); mlxsw_sp 3110 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, mlxsw_sp 3118 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_nexthop_update(mlxsw_sp, adj_index + i, nh); mlxsw_sp 3126 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int __mlxsw_sp_nexthop_ipip_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3132 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[nh->ipip_entry->ipipt]; mlxsw_sp 3133 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return ipip_ops->nexthop_update(mlxsw_sp, adj_index, nh->ipip_entry); mlxsw_sp 3136 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop_ipip_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3145 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_nexthop_ipip_update(mlxsw_sp, adj_index + i, mlxsw_sp 3155 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3176 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c (mlxsw_sp, adj_index, nh); mlxsw_sp 3180 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c (mlxsw_sp, adj_index, nh); mlxsw_sp 3198 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_fib_entries_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3208 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); mlxsw_sp 3263 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fix_adj_grp_size(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3273 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_kvdl_alloc_count_query(mlxsw_sp, mlxsw_sp 3337 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3350 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_fib_entries_update(mlxsw_sp, nh_grp); mlxsw_sp 3367 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_group_update(mlxsw_sp, nh_grp, false); mlxsw_sp 3369 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to update neigh MAC in adjacency table.\n"); mlxsw_sp 3382 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fix_adj_grp_size(mlxsw_sp, &ecmp_size); mlxsw_sp 3387 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_kvdl_alloc(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, mlxsw_sp 3393 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to allocate KVD linear area for nexthop group.\n"); mlxsw_sp 3403 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_group_update(mlxsw_sp, nh_grp, true); mlxsw_sp 3405 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to update neigh MAC in adjacency table.\n"); mlxsw_sp 3413 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_fib_entries_update(mlxsw_sp, nh_grp); mlxsw_sp 3415 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to add adjacency index to fib entries.\n"); mlxsw_sp 3421 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_adj_index_mass_update(mlxsw_sp, nh_grp, mlxsw_sp 3423 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, mlxsw_sp 3426 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to mass-update adjacency index for nexthop group.\n"); mlxsw_sp 3442 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_fib_entries_update(mlxsw_sp, nh_grp); mlxsw_sp 3444 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to set traps for fib entries.\n"); mlxsw_sp 3446 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, mlxsw_sp 3461 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_dead_neigh_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3482 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_remove(mlxsw_sp, neigh_entry); mlxsw_sp 3484 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry); mlxsw_sp 3499 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp); mlxsw_sp 3508 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry); mlxsw_sp 3514 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3526 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_dead_neigh_replace(mlxsw_sp, mlxsw_sp 3529 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_err(mlxsw_sp->bus_info->dev, "Failed to replace dead neigh\n"); mlxsw_sp 3536 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp); mlxsw_sp 3559 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop_neigh_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3583 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c neigh_entry = mlxsw_sp_neigh_entry_lookup(mlxsw_sp, n); mlxsw_sp 3585 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c neigh_entry = mlxsw_sp_neigh_entry_create(mlxsw_sp, n); mlxsw_sp 3597 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c &mlxsw_sp->router->nexthop_neighs_list); mlxsw_sp 3614 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_neigh_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3635 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); mlxsw_sp 3647 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_ipip_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3662 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_ipip_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3674 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static bool mlxsw_sp_nexthop4_ipip_type(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3682 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdev_ipip_type(mlxsw_sp, dev, p_ipipt); mlxsw_sp 3685 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_type_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3690 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_neigh_fini(mlxsw_sp, nh); mlxsw_sp 3695 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_ipip_fini(mlxsw_sp, nh); mlxsw_sp 3700 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop4_type_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3710 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, dev); mlxsw_sp 3712 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; mlxsw_sp 3713 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (ipip_ops->can_offload(mlxsw_sp, dev, mlxsw_sp 3716 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_ipip_init(mlxsw_sp, nh, ipip_entry); mlxsw_sp 3722 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev); mlxsw_sp 3727 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_neigh_init(mlxsw_sp, nh); mlxsw_sp 3738 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop4_type_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3741 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh); mlxsw_sp 3744 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3761 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_insert(mlxsw_sp, nh); mlxsw_sp 3765 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh); mlxsw_sp 3766 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); mlxsw_sp 3776 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop4_type_init(mlxsw_sp, nh, fib_nh); mlxsw_sp 3783 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_remove(mlxsw_sp, nh); mlxsw_sp 3787 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop4_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3790 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_type_fini(mlxsw_sp, nh); mlxsw_sp 3792 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh); mlxsw_sp 3793 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_remove(mlxsw_sp, nh); mlxsw_sp 3796 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop4_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3802 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 3806 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c nh = mlxsw_sp_nexthop_lookup(mlxsw_sp, key); mlxsw_sp 3812 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_type_init(mlxsw_sp, nh, fib_nh); mlxsw_sp 3815 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_type_fini(mlxsw_sp, nh); mlxsw_sp 3819 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp); mlxsw_sp 3822 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_rif_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3842 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp); mlxsw_sp 3846 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_rif_migrate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3855 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_rif_update(mlxsw_sp, new_rif); mlxsw_sp 3858 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop_rif_gone_sync(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3864 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh); mlxsw_sp 3865 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp); mlxsw_sp 3869 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static bool mlxsw_sp_fi_is_gateway(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3875 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_ipip_type(mlxsw_sp, nh, NULL); mlxsw_sp 3879 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_group_create(struct mlxsw_sp *mlxsw_sp, struct fib_info *fi) mlxsw_sp 3895 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c nh_grp->gateway = mlxsw_sp_fi_is_gateway(mlxsw_sp, fi); mlxsw_sp 3901 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop4_init(mlxsw_sp, nh_grp, nh, fib_nh); mlxsw_sp 3905 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_group_insert(mlxsw_sp, nh_grp); mlxsw_sp 3908 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh_grp); mlxsw_sp 3915 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_fini(mlxsw_sp, nh); mlxsw_sp 3923 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_group_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3929 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_remove(mlxsw_sp, nh_grp); mlxsw_sp 3932 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_fini(mlxsw_sp, nh); mlxsw_sp 3934 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh_grp); mlxsw_sp 3940 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop4_group_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3946 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c nh_grp = mlxsw_sp_nexthop4_group_lookup(mlxsw_sp, fi); mlxsw_sp 3948 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c nh_grp = mlxsw_sp_nexthop4_group_create(mlxsw_sp, fi); mlxsw_sp 3957 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop4_group_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3965 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_group_destroy(mlxsw_sp, nh_grp); mlxsw_sp 4181 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_op_remote(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4207 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl); mlxsw_sp 4210 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_op_local(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4231 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl); mlxsw_sp 4234 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_op_trap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4242 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl); mlxsw_sp 4245 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_op_blackhole(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4255 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl); mlxsw_sp 4259 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_op_ipip_decap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4269 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; mlxsw_sp 4270 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return ipip_ops->fib_entry_op(mlxsw_sp, ipip_entry, op, mlxsw_sp 4274 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_op_nve_decap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4283 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl); mlxsw_sp 4286 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int __mlxsw_sp_fib_entry_op(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4292 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op_remote(mlxsw_sp, fib_entry, op); mlxsw_sp 4294 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op_local(mlxsw_sp, fib_entry, op); mlxsw_sp 4296 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op_trap(mlxsw_sp, fib_entry, op); mlxsw_sp 4298 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op_blackhole(mlxsw_sp, fib_entry, op); mlxsw_sp 4300 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op_ipip_decap(mlxsw_sp, mlxsw_sp 4303 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op_nve_decap(mlxsw_sp, fib_entry, op); mlxsw_sp 4308 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_op(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4312 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int err = __mlxsw_sp_fib_entry_op(mlxsw_sp, fib_entry, op); mlxsw_sp 4319 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4322 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op(mlxsw_sp, fib_entry, mlxsw_sp 4326 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4329 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_op(mlxsw_sp, fib_entry, mlxsw_sp 4334 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_type_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4346 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_decap(mlxsw_sp, dev, mlxsw_sp 4350 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_decap_init(mlxsw_sp, mlxsw_sp 4354 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_nve_ipv4_route_is_decap(mlxsw_sp, tb_id, mlxsw_sp 4358 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c t_index = mlxsw_sp_nve_decap_tunnel_index_get(mlxsw_sp); mlxsw_sp 4379 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_fi_is_gateway(mlxsw_sp, fi)) mlxsw_sp 4390 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4403 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib4_entry_type_set(mlxsw_sp, fen_info, fib_entry); mlxsw_sp 4407 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop4_group_get(mlxsw_sp, fib_entry, fen_info->fi); mlxsw_sp 4426 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib4_entry_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4429 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_group_put(mlxsw_sp, &fib4_entry->common); mlxsw_sp 4434 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4442 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find(mlxsw_sp, fen_info->tb_id); mlxsw_sp 4532 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_lpm_tree_link(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4540 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp->router->lpm.proto_trees[fib->proto]; mlxsw_sp 4546 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp_lpm_tree_get(mlxsw_sp, &req_prefix_usage, mlxsw_sp 4551 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); mlxsw_sp 4560 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree); mlxsw_sp 4564 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib_lpm_tree_unlink(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4580 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c lpm_tree = mlxsw_sp_lpm_tree_get(mlxsw_sp, &req_prefix_usage, mlxsw_sp 4585 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree); mlxsw_sp 4592 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree); mlxsw_sp 4595 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_node_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4606 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib_lpm_tree_link(mlxsw_sp, fib_node); mlxsw_sp 4618 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib_node_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4623 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_lpm_tree_unlink(mlxsw_sp, fib_node); mlxsw_sp 4629 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_get(struct mlxsw_sp *mlxsw_sp, u32 tb_id, const void *addr, mlxsw_sp 4638 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_get(mlxsw_sp, tb_id, NULL); mlxsw_sp 4653 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib_node_init(mlxsw_sp, fib_node, fib); mlxsw_sp 4662 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 4666 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib_node_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4673 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_fini(mlxsw_sp, fib_node); mlxsw_sp 4675 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 4767 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib_node_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4785 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry); mlxsw_sp 4788 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib_node_entry_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4801 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_update(mlxsw_sp, n); mlxsw_sp 4806 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_del(mlxsw_sp, fib_entry); mlxsw_sp 4809 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib4_node_entry_link(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4819 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib_node_entry_add(mlxsw_sp, &fib4_entry->common); mlxsw_sp 4831 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_node_entry_unlink(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4834 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_entry_del(mlxsw_sp, &fib4_entry->common); mlxsw_sp 4838 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_entry_decap_fini(mlxsw_sp, &fib4_entry->common); mlxsw_sp 4841 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib4_entry_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4854 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_node_entry_unlink(mlxsw_sp, replaced); mlxsw_sp 4855 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_destroy(mlxsw_sp, replaced); mlxsw_sp 4856 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 4860 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib4_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4868 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 4871 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, fen_info->tb_id, mlxsw_sp 4876 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to get FIB node\n"); mlxsw_sp 4880 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib4_entry = mlxsw_sp_fib4_entry_create(mlxsw_sp, fib_node, fen_info); mlxsw_sp 4882 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to create FIB entry\n"); mlxsw_sp 4887 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib4_node_entry_link(mlxsw_sp, fib4_entry, replace, mlxsw_sp 4890 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to link FIB entry to node\n"); mlxsw_sp 4894 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_replace(mlxsw_sp, fib4_entry, replace); mlxsw_sp 4899 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); mlxsw_sp 4901 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 4905 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_fib4_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 4911 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 4914 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib4_entry = mlxsw_sp_fib4_entry_lookup(mlxsw_sp, fen_info); mlxsw_sp 4919 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_node_entry_unlink(mlxsw_sp, fib4_entry); mlxsw_sp 4920 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); mlxsw_sp 4921 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 5040 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static bool mlxsw_sp_nexthop6_ipip_type(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5045 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_netdev_ipip_type(mlxsw_sp, rt->fib6_nh->fib_nh_dev, ret); mlxsw_sp 5048 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop6_type_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5059 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, dev); mlxsw_sp 5061 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ipip_ops = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]; mlxsw_sp 5062 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (ipip_ops->can_offload(mlxsw_sp, dev, mlxsw_sp 5065 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_ipip_init(mlxsw_sp, nh, ipip_entry); mlxsw_sp 5071 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev); mlxsw_sp 5076 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_neigh_init(mlxsw_sp, nh); mlxsw_sp 5087 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop6_type_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5090 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh); mlxsw_sp 5093 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop6_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5103 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh); mlxsw_sp 5105 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list); mlxsw_sp 5111 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_nexthop6_type_init(mlxsw_sp, nh_grp, nh, rt); mlxsw_sp 5114 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop6_fini(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5117 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_type_fini(mlxsw_sp, nh); mlxsw_sp 5119 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh); mlxsw_sp 5122 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static bool mlxsw_sp_rt6_is_gateway(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5126 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_ipip_type(mlxsw_sp, rt, NULL); mlxsw_sp 5130 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5149 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c nh_grp->gateway = mlxsw_sp_rt6_is_gateway(mlxsw_sp, mlxsw_sp_rt6->rt); mlxsw_sp 5155 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop6_init(mlxsw_sp, nh_grp, nh, rt); mlxsw_sp 5161 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop_group_insert(mlxsw_sp, nh_grp); mlxsw_sp 5165 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh_grp); mlxsw_sp 5172 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_fini(mlxsw_sp, nh); mlxsw_sp 5179 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5185 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_remove(mlxsw_sp, nh_grp); mlxsw_sp 5188 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_fini(mlxsw_sp, nh); mlxsw_sp 5190 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh_grp); mlxsw_sp 5195 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_nexthop6_group_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5200 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c nh_grp = mlxsw_sp_nexthop6_group_lookup(mlxsw_sp, fib6_entry); mlxsw_sp 5202 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c nh_grp = mlxsw_sp_nexthop6_group_create(mlxsw_sp, fib6_entry); mlxsw_sp 5214 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_nexthop6_group_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5222 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_destroy(mlxsw_sp, nh_grp); mlxsw_sp 5226 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5235 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop6_group_get(mlxsw_sp, fib6_entry); mlxsw_sp 5243 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib_node_entry_add(mlxsw_sp, &fib6_entry->common); mlxsw_sp 5248 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_destroy(mlxsw_sp, old_nh_grp); mlxsw_sp 5253 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_put(mlxsw_sp, &fib6_entry->common); mlxsw_sp 5262 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_nexthop_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5280 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop6_group_update(mlxsw_sp, fib6_entry); mlxsw_sp 5300 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_nexthop_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5318 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_update(mlxsw_sp, fib6_entry); mlxsw_sp 5321 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib6_entry_type_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5337 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c else if (mlxsw_sp_rt6_is_gateway(mlxsw_sp, rt)) mlxsw_sp 5357 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5383 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_type_set(mlxsw_sp, fib_entry, rt_arr[0]); mlxsw_sp 5385 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_nexthop6_group_get(mlxsw_sp, fib6_entry); mlxsw_sp 5407 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib6_entry_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5410 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop6_group_put(mlxsw_sp, &fib6_entry->common); mlxsw_sp 5487 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_fib6_node_entry_link(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5497 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib_node_entry_add(mlxsw_sp, &fib6_entry->common); mlxsw_sp 5509 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_node_entry_unlink(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5512 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_entry_del(mlxsw_sp, &fib6_entry->common); mlxsw_sp 5517 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_lookup(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5525 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find(mlxsw_sp, rt->fib6_table->tb6_id); mlxsw_sp 5548 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib6_entry_replace(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5560 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_node_entry_unlink(mlxsw_sp, replaced); mlxsw_sp 5561 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_destroy(mlxsw_sp, replaced); mlxsw_sp 5562 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 5565 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_router_fib6_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5574 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 5583 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, rt->fib6_table->tb6_id, mlxsw_sp 5596 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib6_entry_nexthop_add(mlxsw_sp, fib6_entry, mlxsw_sp 5603 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib6_entry = mlxsw_sp_fib6_entry_create(mlxsw_sp, fib_node, rt_arr, mlxsw_sp 5610 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_fib6_node_entry_link(mlxsw_sp, fib6_entry, &replace); mlxsw_sp 5614 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_replace(mlxsw_sp, fib6_entry, replace); mlxsw_sp 5619 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_destroy(mlxsw_sp, fib6_entry); mlxsw_sp 5622 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 5626 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_fib6_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5634 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 5645 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib6_entry = mlxsw_sp_fib6_entry_lookup(mlxsw_sp, rt); mlxsw_sp 5653 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_nexthop_del(mlxsw_sp, fib6_entry, rt_arr, mlxsw_sp 5660 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_node_entry_unlink(mlxsw_sp, fib6_entry); mlxsw_sp 5661 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_destroy(mlxsw_sp, fib6_entry); mlxsw_sp 5662 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 5665 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int __mlxsw_sp_router_set_abort_trap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5674 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl); mlxsw_sp 5679 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralst), ralst_pl); mlxsw_sp 5683 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); i++) { mlxsw_sp 5684 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp_vr *vr = &mlxsw_sp->router->vrs[i]; mlxsw_sp 5689 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(raltb), mlxsw_sp 5697 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), mlxsw_sp 5715 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_router_fibmr_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5722 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 5725 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_get(mlxsw_sp, men_info->tb_id, NULL); mlxsw_sp 5733 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_fibmr_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5739 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 5742 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find(mlxsw_sp, men_info->tb_id); mlxsw_sp 5748 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 5752 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fibmr_vif_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5759 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 5762 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_get(mlxsw_sp, ven_info->tb_id, NULL); mlxsw_sp 5767 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, ven_info->dev); mlxsw_sp 5774 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fibmr_vif_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5780 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 5783 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_find(mlxsw_sp, ven_info->tb_id); mlxsw_sp 5789 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 5792 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_router_set_abort_trap(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 5797 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_router_set_abort_trap(mlxsw_sp, proto, mlxsw_sp 5807 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return __mlxsw_sp_router_set_abort_trap(mlxsw_sp, proto, mlxsw_sp 5811 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib4_node_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5820 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_node_entry_unlink(mlxsw_sp, fib4_entry); mlxsw_sp 5821 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_entry_destroy(mlxsw_sp, fib4_entry); mlxsw_sp 5822 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 5832 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib6_node_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5841 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_node_entry_unlink(mlxsw_sp, fib6_entry); mlxsw_sp 5842 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_entry_destroy(mlxsw_sp, fib6_entry); mlxsw_sp 5843 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_put(mlxsw_sp, fib_node); mlxsw_sp 5849 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_fib_node_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5854 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib4_node_flush(mlxsw_sp, fib_node); mlxsw_sp 5857 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib6_node_flush(mlxsw_sp, fib_node); mlxsw_sp 5862 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_vr_fib_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 5872 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_fib_node_flush(mlxsw_sp, fib_node); mlxsw_sp 5878 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_fib_flush(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 5882 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_VRS); i++) { mlxsw_sp 5883 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp_vr *vr = &mlxsw_sp->router->vrs[i]; mlxsw_sp 5890 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_fib_flush(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV4); mlxsw_sp 5897 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_fib_flush(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV6); mlxsw_sp 5901 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_fib_abort(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 5905 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 5907 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "FIB abort triggered. Note that FIB entries are no longer being offloaded to this device.\n"); mlxsw_sp 5908 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_flush(mlxsw_sp); mlxsw_sp 5909 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->aborted = true; mlxsw_sp 5910 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_set_abort_trap(mlxsw_sp); mlxsw_sp 5912 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c dev_warn(mlxsw_sp->bus_info->dev, "Failed to set abort trap.\n"); mlxsw_sp 5930 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 5986 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = fib_work->mlxsw_sp; mlxsw_sp 5992 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_span_respin(mlxsw_sp); mlxsw_sp 6000 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_fib4_add(mlxsw_sp, &fib_work->fen_info, mlxsw_sp 6003 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_abort(mlxsw_sp); mlxsw_sp 6007 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib4_del(mlxsw_sp, &fib_work->fen_info); mlxsw_sp 6014 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_abort(mlxsw_sp); mlxsw_sp 6018 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop4_event(mlxsw_sp, fib_work->event, mlxsw_sp 6031 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = fib_work->mlxsw_sp; mlxsw_sp 6036 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_span_respin(mlxsw_sp); mlxsw_sp 6042 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_fib6_add(mlxsw_sp, mlxsw_sp 6047 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_abort(mlxsw_sp); mlxsw_sp 6051 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib6_del(mlxsw_sp, mlxsw_sp 6060 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_abort(mlxsw_sp); mlxsw_sp 6071 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = fib_work->mlxsw_sp; mlxsw_sp 6081 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_fibmr_add(mlxsw_sp, &fib_work->men_info, mlxsw_sp 6084 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_abort(mlxsw_sp); mlxsw_sp 6088 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fibmr_del(mlxsw_sp, &fib_work->men_info); mlxsw_sp 6092 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_fibmr_vif_add(mlxsw_sp, mlxsw_sp 6095 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_abort(mlxsw_sp); mlxsw_sp 6099 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fibmr_vif_del(mlxsw_sp, mlxsw_sp 6107 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_abort(mlxsw_sp); mlxsw_sp 6186 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp) mlxsw_sp 6197 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->aborted) mlxsw_sp 6253 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c router->mlxsw_sp); mlxsw_sp 6293 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c fib_work->mlxsw_sp = router->mlxsw_sp; mlxsw_sp 6324 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6329 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) mlxsw_sp 6330 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp->router->rifs[i] && mlxsw_sp 6331 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs[i]->dev == dev) mlxsw_sp 6332 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp->router->rifs[i]; mlxsw_sp 6337 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_router_rif_disable(struct mlxsw_sp *mlxsw_sp, u16 rif) mlxsw_sp 6343 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 6348 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 6351 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_router_rif_gone_sync(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6354 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_rif_disable(mlxsw_sp, rif->rif_index); mlxsw_sp 6355 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_nexthop_rif_gone_sync(mlxsw_sp, rif); mlxsw_sp 6356 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_rif_gone_sync(mlxsw_sp, rif); mlxsw_sp 6400 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_dev_rif_type(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6405 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (mlxsw_sp_netdev_ipip_type(mlxsw_sp, dev, NULL)) mlxsw_sp 6418 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fid_type_rif_type(mlxsw_sp, type); mlxsw_sp 6421 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_rif_index_alloc(struct mlxsw_sp *mlxsw_sp, u16 *p_rif_index) mlxsw_sp 6425 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { mlxsw_sp 6426 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp->router->rifs[i]) { mlxsw_sp 6458 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp_rif *mlxsw_sp_rif_by_index(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6461 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp->router->rifs[rif_index]; mlxsw_sp 6479 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_vr = mlxsw_sp_vr_get(lb_rif->common.mlxsw_sp, ul_tb_id, NULL); mlxsw_sp 6507 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6520 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c type = mlxsw_sp_dev_rif_type(mlxsw_sp, params->dev); mlxsw_sp 6521 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ops = mlxsw_sp->rif_ops_arr[type]; mlxsw_sp 6523 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_get(mlxsw_sp, tb_id ? : RT_TABLE_MAIN, extack); mlxsw_sp 6528 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_index_alloc(mlxsw_sp, &rif_index); mlxsw_sp 6540 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs[rif_index] = rif; mlxsw_sp 6541 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif->mlxsw_sp = mlxsw_sp; mlxsw_sp 6578 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs[rif_index] = NULL; mlxsw_sp 6584 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 6591 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 6596 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_rif_gone_sync(mlxsw_sp, rif); mlxsw_sp 6597 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = &mlxsw_sp->router->vrs[rif->vr_id]; mlxsw_sp 6606 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs[rif->rif_index] = NULL; mlxsw_sp 6610 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 6613 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_rif_destroy_by_dev(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6618 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev); mlxsw_sp 6645 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_subport_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6652 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, params->dev); mlxsw_sp 6654 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_rif_create(mlxsw_sp, params, extack); mlxsw_sp 6678 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 6688 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_subport_get(mlxsw_sp, ¶ms, extack); mlxsw_sp 6811 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_inetaddr_bridge_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6823 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_create(mlxsw_sp, ¶ms, extack); mlxsw_sp 6828 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, l3_dev); mlxsw_sp 6836 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_inetaddr_vlan_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6854 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_inetaddr_bridge_event(mlxsw_sp, vlan_dev, event, mlxsw_sp 6876 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_rif_vrrp_op(struct mlxsw_sp *mlxsw_sp, u16 rif_index, mlxsw_sp 6888 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 6897 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 6900 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_rif_macvlan_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6908 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, vlan->lowerdev); mlxsw_sp 6914 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_fdb_op(mlxsw_sp, macvlan_dev->dev_addr, mlxsw_sp 6919 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_vrrp_op(mlxsw_sp, rif->rif_index, mlxsw_sp 6933 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_fdb_op(mlxsw_sp, macvlan_dev->dev_addr, mlxsw_sp 6938 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_rif_macvlan_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6944 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, vlan->lowerdev); mlxsw_sp 6950 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_vrrp_op(mlxsw_sp, rif->rif_index, macvlan_dev->dev_addr, mlxsw_sp 6952 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_fdb_op(mlxsw_sp, macvlan_dev->dev_addr, mlxsw_sp 6956 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_inetaddr_macvlan_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6963 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_rif_macvlan_add(mlxsw_sp, macvlan_dev, extack); mlxsw_sp 6965 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_macvlan_del(mlxsw_sp, macvlan_dev); mlxsw_sp 6972 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_router_port_check_rif_addr(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 6986 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { mlxsw_sp 6987 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp->router->rifs[i]; mlxsw_sp 6993 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->mac_mask)) { mlxsw_sp 7002 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int __mlxsw_sp_inetaddr_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 7012 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_inetaddr_bridge_event(mlxsw_sp, dev, event, mlxsw_sp 7015 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_inetaddr_vlan_event(mlxsw_sp, dev, event, mlxsw_sp 7018 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_inetaddr_macvlan_event(mlxsw_sp, dev, event, mlxsw_sp 7038 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(router->mlxsw_sp, dev); mlxsw_sp 7042 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_inetaddr_event(router->mlxsw_sp, dev, event, NULL); mlxsw_sp 7052 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 7056 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp = mlxsw_sp_lower_get(dev); mlxsw_sp 7057 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp) mlxsw_sp 7060 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev); mlxsw_sp 7064 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_port_check_rif_addr(mlxsw_sp, dev, dev->dev_addr, mlxsw_sp 7069 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_inetaddr_event(mlxsw_sp, dev, event, ivi->extack); mlxsw_sp 7076 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 7085 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = inet6addr_work->mlxsw_sp; mlxsw_sp 7092 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev); mlxsw_sp 7096 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_inetaddr_event(mlxsw_sp, dev, event, NULL); mlxsw_sp 7122 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c inet6addr_work->mlxsw_sp = router->mlxsw_sp; mlxsw_sp 7136 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 7140 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp = mlxsw_sp_lower_get(dev); mlxsw_sp 7141 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp) mlxsw_sp 7144 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev); mlxsw_sp 7148 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_router_port_check_rif_addr(mlxsw_sp, dev, dev->dev_addr, mlxsw_sp 7153 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_inetaddr_event(mlxsw_sp, dev, event, i6vi->extack); mlxsw_sp 7158 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_rif_edit(struct mlxsw_sp *mlxsw_sp, u16 rif_index, mlxsw_sp 7165 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 7172 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 7176 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port_change_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 7185 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_fdb_op(mlxsw_sp, rif->addr, fid_index, false); mlxsw_sp 7189 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_edit(mlxsw_sp, rif->rif_index, dev->dev_addr, mlxsw_sp 7194 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_fdb_op(mlxsw_sp, dev->dev_addr, fid_index, true); mlxsw_sp 7206 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = &mlxsw_sp->router->vrs[rif->vr_id]; mlxsw_sp 7220 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_edit(mlxsw_sp, rif->rif_index, rif->addr, rif->mtu); mlxsw_sp 7222 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_fdb_op(mlxsw_sp, rif->addr, fid_index, true); mlxsw_sp 7232 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_router_port_check_rif_addr(rif->mlxsw_sp, rif->dev, mlxsw_sp 7239 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 7242 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp = mlxsw_sp_lower_get(dev); mlxsw_sp 7243 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp) mlxsw_sp 7246 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev); mlxsw_sp 7253 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_router_port_change_event(mlxsw_sp, rif); mlxsw_sp 7261 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_port_vrf_join(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 7270 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, l3_dev); mlxsw_sp 7272 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_inetaddr_event(mlxsw_sp, l3_dev, NETDEV_DOWN, mlxsw_sp 7275 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return __mlxsw_sp_inetaddr_event(mlxsw_sp, l3_dev, NETDEV_UP, extack); mlxsw_sp 7278 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_port_vrf_leave(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 7283 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, l3_dev); mlxsw_sp 7286 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_inetaddr_event(mlxsw_sp, l3_dev, NETDEV_DOWN, NULL); mlxsw_sp 7292 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(l3_dev); mlxsw_sp 7298 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp || netif_is_macvlan(l3_dev)) mlxsw_sp 7309 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_port_vrf_join(mlxsw_sp, l3_dev, extack); mlxsw_sp 7311 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_port_vrf_leave(mlxsw_sp, l3_dev); mlxsw_sp 7326 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_rif_fdb_op(rif->mlxsw_sp, dev->dev_addr, mlxsw_sp 7357 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7370 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 7381 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_fdb_op(rif->mlxsw_sp, rif->dev->dev_addr, mlxsw_sp 7399 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_fdb_op(rif->mlxsw_sp, rif->dev->dev_addr, mlxsw_sp 7409 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_fid_rfid_get(rif->mlxsw_sp, rif->rif_index); mlxsw_sp 7425 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7433 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 7436 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c u8 mlxsw_sp_router_port(const struct mlxsw_sp *mlxsw_sp) mlxsw_sp 7438 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_core_max_ports(mlxsw_sp->core) + 1; mlxsw_sp 7443 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7452 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), true); mlxsw_sp 7457 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), true); mlxsw_sp 7461 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_fdb_op(rif->mlxsw_sp, rif->dev->dev_addr, mlxsw_sp 7471 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7474 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7483 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7487 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_fdb_op(rif->mlxsw_sp, rif->dev->dev_addr, mlxsw_sp 7491 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7493 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7518 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_bridge_fid_get(rif->mlxsw_sp, br_dev, vid, extack); mlxsw_sp 7550 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7560 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), true); mlxsw_sp 7565 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), true); mlxsw_sp 7569 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_fdb_op(rif->mlxsw_sp, rif->dev->dev_addr, mlxsw_sp 7579 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7582 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7591 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7595 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rif_fdb_op(rif->mlxsw_sp, rif->dev->dev_addr, mlxsw_sp 7599 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7601 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_port(mlxsw_sp), false); mlxsw_sp 7609 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_bridge_fid_get(rif->mlxsw_sp, rif->dev, 0, extack); mlxsw_sp 7669 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7673 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_vr = mlxsw_sp_vr_get(mlxsw_sp, ul_tb_id, NULL); mlxsw_sp 7687 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, ul_vr); mlxsw_sp 7694 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7697 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_vr = &mlxsw_sp->router->vrs[lb_rif->ul_vr_id]; mlxsw_sp 7701 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, ul_vr); mlxsw_sp 7722 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = ul_rif->mlxsw_sp; mlxsw_sp 7730 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl); mlxsw_sp 7734 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ul_rif_create(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_vr *vr, mlxsw_sp 7741 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rif_index_alloc(mlxsw_sp, &rif_index); mlxsw_sp 7751 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs[rif_index] = ul_rif; mlxsw_sp 7752 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_rif->mlxsw_sp = mlxsw_sp; mlxsw_sp 7760 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs[rif_index] = NULL; mlxsw_sp 7767 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = ul_rif->mlxsw_sp; mlxsw_sp 7770 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs[ul_rif->rif_index] = NULL; mlxsw_sp 7775 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ul_rif_get(struct mlxsw_sp *mlxsw_sp, u32 tb_id, mlxsw_sp 7781 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = mlxsw_sp_vr_get(mlxsw_sp, tb_id, extack); mlxsw_sp 7788 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr->ul_rif = mlxsw_sp_ul_rif_create(mlxsw_sp, vr, extack); mlxsw_sp 7800 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 7806 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = ul_rif->mlxsw_sp; mlxsw_sp 7809 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c vr = &mlxsw_sp->router->vrs[ul_rif->vr_id]; mlxsw_sp 7816 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vr_put(mlxsw_sp, vr); mlxsw_sp 7819 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_router_ul_rif_get(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id, mlxsw_sp 7826 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_rif = mlxsw_sp_ul_rif_get(mlxsw_sp, ul_tb_id, NULL); mlxsw_sp 7834 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_router_ul_rif_put(struct mlxsw_sp *mlxsw_sp, u16 ul_rif_index) mlxsw_sp 7840 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_rif = mlxsw_sp->router->rifs[ul_rif_index]; mlxsw_sp 7852 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7856 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_rif = mlxsw_sp_ul_rif_get(mlxsw_sp, ul_tb_id, NULL); mlxsw_sp 7877 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c struct mlxsw_sp *mlxsw_sp = rif->mlxsw_sp; mlxsw_sp 7880 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c ul_rif = mlxsw_sp_rif_by_index(mlxsw_sp, lb_rif->ul_rif_id); mlxsw_sp 7900 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_rifs_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 7902 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c u64 max_rifs = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); mlxsw_sp 7904 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->rifs = kcalloc(max_rifs, mlxsw_sp 7907 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!mlxsw_sp->router->rifs) mlxsw_sp 7913 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_rifs_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 7917 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) mlxsw_sp 7918 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c WARN_ON_ONCE(mlxsw_sp->router->rifs[i]); mlxsw_sp 7920 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c kfree(mlxsw_sp->router->rifs); mlxsw_sp 7924 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipip_config_tigcr(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 7929 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tigcr), tigcr_pl); mlxsw_sp 7932 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_ipips_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 7934 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->ipip_ops_arr = mlxsw_sp_ipip_ops_arr; mlxsw_sp 7935 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c INIT_LIST_HEAD(&mlxsw_sp->router->ipip_list); mlxsw_sp 7936 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_sp_ipip_config_tigcr(mlxsw_sp); mlxsw_sp 7939 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void mlxsw_sp_ipips_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 7941 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c WARN_ON(!list_empty(&mlxsw_sp->router->ipip_list)); mlxsw_sp 7954 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_router_fib_flush(router->mlxsw_sp); mlxsw_sp 8008 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_mp_hash_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 8013 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c seed = jhash(mlxsw_sp->base_mac, sizeof(mlxsw_sp->base_mac), 0); mlxsw_sp 8018 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(recr2), recr2_pl); mlxsw_sp 8021 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_mp_hash_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 8027 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int mlxsw_sp_dscp_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 8042 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rdpm), rdpm_pl); mlxsw_sp 8045 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static int __mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 8052 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_RIFS)) mlxsw_sp 8054 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c max_rifs = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); mlxsw_sp 8059 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rgcr), rgcr_pl); mlxsw_sp 8065 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c static void __mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 8070 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rgcr), rgcr_pl); mlxsw_sp 8073 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 8078 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c router = kzalloc(sizeof(*mlxsw_sp->router), GFP_KERNEL); mlxsw_sp 8081 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router = router; mlxsw_sp 8082 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c router->mlxsw_sp = mlxsw_sp; mlxsw_sp 8094 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c INIT_LIST_HEAD(&mlxsw_sp->router->nexthop_neighs_list); mlxsw_sp 8095 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = __mlxsw_sp_router_init(mlxsw_sp); mlxsw_sp 8099 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_rifs_init(mlxsw_sp); mlxsw_sp 8103 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_ipips_init(mlxsw_sp); mlxsw_sp 8107 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = rhashtable_init(&mlxsw_sp->router->nexthop_ht, mlxsw_sp 8112 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = rhashtable_init(&mlxsw_sp->router->nexthop_group_ht, mlxsw_sp 8117 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c INIT_LIST_HEAD(&mlxsw_sp->router->nexthop_list); mlxsw_sp 8118 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_lpm_init(mlxsw_sp); mlxsw_sp 8122 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_mr_init(mlxsw_sp, &mlxsw_sp_mr_tcam_ops); mlxsw_sp 8126 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_vrs_init(mlxsw_sp); mlxsw_sp 8130 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_neigh_init(mlxsw_sp); mlxsw_sp 8134 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->netevent_nb.notifier_call = mlxsw_sp 8136 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = register_netevent_notifier(&mlxsw_sp->router->netevent_nb); mlxsw_sp 8140 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_mp_hash_init(mlxsw_sp); mlxsw_sp 8144 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = mlxsw_sp_dscp_init(mlxsw_sp); mlxsw_sp 8148 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp->router->fib_nb.notifier_call = mlxsw_sp_router_fib_event; mlxsw_sp 8149 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c err = register_fib_notifier(&mlxsw_sp->router->fib_nb, mlxsw_sp 8159 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c unregister_netevent_notifier(&mlxsw_sp->router->netevent_nb); mlxsw_sp 8161 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_fini(mlxsw_sp); mlxsw_sp 8163 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vrs_fini(mlxsw_sp); mlxsw_sp 8165 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_mr_fini(mlxsw_sp); mlxsw_sp 8167 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_fini(mlxsw_sp); mlxsw_sp 8169 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_destroy(&mlxsw_sp->router->nexthop_group_ht); mlxsw_sp 8171 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_destroy(&mlxsw_sp->router->nexthop_ht); mlxsw_sp 8173 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipips_fini(mlxsw_sp); mlxsw_sp 8175 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rifs_fini(mlxsw_sp); mlxsw_sp 8177 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_router_fini(mlxsw_sp); mlxsw_sp 8183 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c kfree(mlxsw_sp->router); mlxsw_sp 8187 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 8189 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c unregister_fib_notifier(&mlxsw_sp->router->fib_nb); mlxsw_sp 8190 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c unregister_netevent_notifier(&mlxsw_sp->router->netevent_nb); mlxsw_sp 8191 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_neigh_fini(mlxsw_sp); mlxsw_sp 8192 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_vrs_fini(mlxsw_sp); mlxsw_sp 8193 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_mr_fini(mlxsw_sp); mlxsw_sp 8194 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_lpm_fini(mlxsw_sp); mlxsw_sp 8195 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_destroy(&mlxsw_sp->router->nexthop_group_ht); mlxsw_sp 8196 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c rhashtable_destroy(&mlxsw_sp->router->nexthop_ht); mlxsw_sp 8197 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_ipips_fini(mlxsw_sp); mlxsw_sp 8198 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c mlxsw_sp_rifs_fini(mlxsw_sp); mlxsw_sp 8199 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c __mlxsw_sp_router_fini(mlxsw_sp); mlxsw_sp 8200 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c unregister_inet6addr_notifier(&mlxsw_sp->router->inet6addr_nb); mlxsw_sp 8201 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c unregister_inetaddr_notifier(&mlxsw_sp->router->inetaddr_nb); mlxsw_sp 8202 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c kfree(mlxsw_sp->router); mlxsw_sp 27 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h struct mlxsw_sp_rif *mlxsw_sp_rif_by_index(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 36 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h int mlxsw_sp_rif_counter_value_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 40 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h void mlxsw_sp_rif_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 43 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h int mlxsw_sp_rif_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 59 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h int mlxsw_sp_neigh_counter_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 63 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h mlxsw_sp_neigh_entry_counter_update(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 67 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h int __mlxsw_sp_ipip_entry_update_tunnel(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 73 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h void mlxsw_sp_ipip_entry_demote_tunnel(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 76 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h mlxsw_sp_ipip_demote_tunnel_by_saddr(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 92 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h int mlxsw_sp_nexthop_counter_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 94 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h int mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, mlxsw_sp 96 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h void mlxsw_sp_nexthop_counter_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 98 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h void mlxsw_sp_nexthop_counter_free(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 17 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c int mlxsw_sp_span_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 21 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c if (!MLXSW_CORE_RES_VALID(mlxsw_sp->core, MAX_SPAN)) mlxsw_sp 24 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp->span.entries_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 26 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp->span.entries = kcalloc(mlxsw_sp->span.entries_count, mlxsw_sp 29 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c if (!mlxsw_sp->span.entries) mlxsw_sp 32 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 33 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; mlxsw_sp 42 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c void mlxsw_sp_span_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 46 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 47 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; mlxsw_sp 51 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c kfree(mlxsw_sp->span.entries); mlxsw_sp 67 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = dest_port->mlxsw_sp; mlxsw_sp 76 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpat), mpat_pl); mlxsw_sp 84 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = dest_port->mlxsw_sp; mlxsw_sp 90 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpat), mpat_pl); mlxsw_sp 200 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c bridge_port = mlxsw_sp_bridge_port_find(port->mlxsw_sp->bridge, dev); mlxsw_sp 362 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = dest_port->mlxsw_sp; mlxsw_sp 379 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpat), mpat_pl); mlxsw_sp 463 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = dest_port->mlxsw_sp; mlxsw_sp 479 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpat), mpat_pl); mlxsw_sp 526 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = dest_port->mlxsw_sp; mlxsw_sp 535 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpat), mpat_pl); mlxsw_sp 591 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_configure(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 596 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c if (sparms.dest_port->mlxsw_sp != mlxsw_sp) { mlxsw_sp 618 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_create(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 627 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 628 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c if (!mlxsw_sp->span.entries[i].ref_count) { mlxsw_sp 629 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c span_entry = &mlxsw_sp->span.entries[i]; mlxsw_sp 639 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_configure(mlxsw_sp, span_entry, sparms); mlxsw_sp 650 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_find_by_port(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 655 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 656 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; mlxsw_sp 664 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c void mlxsw_sp_span_entry_invalidate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 672 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_find_by_id(struct mlxsw_sp *mlxsw_sp, int span_id) mlxsw_sp 676 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 677 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; mlxsw_sp 686 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 693 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c span_entry = mlxsw_sp_span_entry_find_by_port(mlxsw_sp, to_dev); mlxsw_sp 700 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c return mlxsw_sp_span_entry_create(mlxsw_sp, to_dev, ops, sparms); mlxsw_sp 703 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c static int mlxsw_sp_span_entry_put(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 714 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp; mlxsw_sp 718 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 719 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; mlxsw_sp 730 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c static int mlxsw_sp_span_mtu_to_buffsize(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 733 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c return mlxsw_sp_bytes_cells(mlxsw_sp, mtu * 5 / 2) + 1; mlxsw_sp 738 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp; mlxsw_sp 746 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c u32 buffsize = mlxsw_sp_span_mtu_to_buffsize(mlxsw_sp, mtu); mlxsw_sp 749 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbib), sbib_pl); mlxsw_sp 781 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp; mlxsw_sp 788 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mpar), mpar_pl); mlxsw_sp 798 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp; mlxsw_sp 807 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 809 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c &mlxsw_sp->span.entries[i]; mlxsw_sp 818 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c u32 buffsize = mlxsw_sp_span_mtu_to_buffsize(mlxsw_sp, mlxsw_sp 822 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbib), sbib_pl); mlxsw_sp 855 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbib), sbib_pl); mlxsw_sp 867 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp; mlxsw_sp 881 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbib), sbib_pl); mlxsw_sp 884 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_put(mlxsw_sp, span_entry); mlxsw_sp 891 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_ops(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 908 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp *mlxsw_sp = from->mlxsw_sp; mlxsw_sp 914 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c ops = mlxsw_sp_span_entry_ops(mlxsw_sp, to_dev); mlxsw_sp 924 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c span_entry = mlxsw_sp_span_entry_get(mlxsw_sp, to_dev, ops, sparms); mlxsw_sp 939 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_put(mlxsw_sp, span_entry); mlxsw_sp 948 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c span_entry = mlxsw_sp_span_entry_find_by_id(from->mlxsw_sp, span_id); mlxsw_sp 959 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 965 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c for (i = 0; i < mlxsw_sp->span.entries_count; i++) { mlxsw_sp 966 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c struct mlxsw_sp_span_entry *curr = &mlxsw_sp->span.entries[i]; mlxsw_sp 978 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c mlxsw_sp_span_entry_configure(mlxsw_sp, curr, sparms); mlxsw_sp 12 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h struct mlxsw_sp; mlxsw_sp 59 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h int mlxsw_sp_span_init(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 60 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h void mlxsw_sp_span_fini(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 61 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp); mlxsw_sp 70 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h mlxsw_sp_span_entry_find_by_port(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 73 drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h void mlxsw_sp_span_entry_invalidate(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 29 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 101 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 132 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bool mlxsw_sp_bridge_device_is_offloaded(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 135 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return !!mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 141 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = data; mlxsw_sp 143 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_rif_destroy_by_dev(mlxsw_sp, dev); mlxsw_sp 147 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_bridge_device_rifs_destroy(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 150 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_rif_destroy_by_dev(mlxsw_sp, dev); mlxsw_sp 153 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp); mlxsw_sp 160 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct device *dev = bridge->mlxsw_sp->bus_info->dev; mlxsw_sp 194 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_device_rifs_destroy(bridge->mlxsw_sp, mlxsw_sp 467 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp_port->mlxsw_sp->bridge, mlxsw_sp 605 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp_port->mlxsw_sp->bridge, mlxsw_sp 636 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_ageing_set(struct mlxsw_sp *mlxsw_sp, u32 ageing_time) mlxsw_sp 642 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfdat), sfdat_pl); mlxsw_sp 645 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp->bridge->ageing_time = ageing_time; mlxsw_sp 653 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 665 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_sp_ageing_set(mlxsw_sp, ageing_time); mlxsw_sp 673 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 679 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 701 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp_port->mlxsw_sp->bridge, mlxsw_sp 736 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 747 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 773 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_smid_router_port_set(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 784 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_router_port(mlxsw_sp), add); mlxsw_sp 785 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(smid), smid_pl); mlxsw_sp 791 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_mrouter_update_mdb(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 798 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_smid_router_port_set(mlxsw_sp, mid->mid, add); mlxsw_sp 807 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 816 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 821 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_mrouter_update_mdb(mlxsw_sp, bridge_device, mlxsw_sp 880 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_span_respin(mlxsw_sp_port->mlxsw_sp); mlxsw_sp 1002 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_get(mlxsw_sp_port->mlxsw_sp->bridge, mlxsw_sp 1041 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_fdb_flush(mlxsw_sp_port->mlxsw_sp, mlxsw_sp 1049 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_put(mlxsw_sp_port->mlxsw_sp->bridge, bridge_port); mlxsw_sp 1106 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_br_ban_rif_pvid_change(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1115 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, br_dev); mlxsw_sp 1145 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1156 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_br_ban_rif_pvid_change(mlxsw_sp, mlxsw_sp 1166 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 1193 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1206 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfdf), sfdf_pl); mlxsw_sp 1221 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_port_fdb_tunnel_uc_op(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1254 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); mlxsw_sp 1266 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 1282 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); mlxsw_sp 1294 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, mlxsw_sp 1298 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, adding, mlxsw_sp 1303 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, mlxsw_sp 1306 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, 0, mac, fid, adding, mlxsw_sp 1311 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id, mlxsw_sp 1328 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); mlxsw_sp 1344 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1351 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 1366 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_sp_port_fdb_uc_op(mlxsw_sp, mlxsw_sp 1371 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp, mlxsw_sp 1377 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_port_mdb_op(struct mlxsw_sp *mlxsw_sp, const char *addr, mlxsw_sp 1392 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); mlxsw_sp 1404 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_port_smid_full_entry(struct mlxsw_sp *mlxsw_sp, u16 mid_idx, mlxsw_sp 1416 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c for (i = 1; i < mlxsw_core_max_ports(mlxsw_sp->core); i++) { mlxsw_sp 1417 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (mlxsw_sp->ports[i]) mlxsw_sp 1422 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_router_port(mlxsw_sp), 1); mlxsw_sp 1424 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c for_each_set_bit(i, ports_bitmap, mlxsw_core_max_ports(mlxsw_sp->core)) mlxsw_sp 1427 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_reg_smid_port_set(smid_pl, mlxsw_sp_router_port(mlxsw_sp), mlxsw_sp 1430 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(smid), smid_pl); mlxsw_sp 1438 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1447 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(smid), smid_pl); mlxsw_sp 1467 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_get_ports_bitmap(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1478 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c max_lag_members = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 1482 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_port = mlxsw_sp_port_lagged_get(mlxsw_sp, mlxsw_sp 1494 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1500 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_get_ports_bitmap(mlxsw_sp, mlxsw_sp 1508 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_mc_write_mdb_entry(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1518 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mid_idx = find_first_zero_bit(mlxsw_sp->bridge->mids_bitmap, mlxsw_sp 1523 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c num_of_ports = mlxsw_core_max_ports(mlxsw_sp->core); mlxsw_sp 1530 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_mc_get_mrouters_bitmap(flood_bitmap, bridge_device, mlxsw_sp); mlxsw_sp 1533 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_smid_full_entry(mlxsw_sp, mid_idx, flood_bitmap, mlxsw_sp 1539 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_mdb_op(mlxsw_sp, mid->addr, mid->fid, mid_idx, mlxsw_sp 1544 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c set_bit(mid_idx, mlxsw_sp->bridge->mids_bitmap); mlxsw_sp 1549 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_mc_remove_mdb_entry(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1555 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c clear_bit(mid->mid, mlxsw_sp->bridge->mids_bitmap); mlxsw_sp 1557 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_sp_port_mdb_op(mlxsw_sp, mid->addr, mid->fid, mid->mid, mlxsw_sp 1562 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_mid *__mlxsw_sp_mc_alloc(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1575 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c BITS_TO_LONGS(mlxsw_core_max_ports(mlxsw_sp->core)); mlxsw_sp 1588 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (!mlxsw_sp_mc_write_mdb_entry(mlxsw_sp, mid, bridge_device)) mlxsw_sp 1605 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1610 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_core_max_ports(mlxsw_sp->core))) { mlxsw_sp 1611 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_mc_remove_mdb_entry(mlxsw_sp, mid); mlxsw_sp 1623 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1636 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 1651 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mid = __mlxsw_sp_mc_alloc(mlxsw_sp, bridge_device, mdb->addr, mlxsw_sp 1684 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1692 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_mc_write_mdb_entry(mlxsw_sp, mid, mlxsw_sp 1695 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_mc_remove_mdb_entry(mlxsw_sp, mid); mlxsw_sp 1717 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 1726 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_span_respin(respin_work->mlxsw_sp); mlxsw_sp 1731 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_span_respin_schedule(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 1740 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c respin_work->mlxsw_sp = mlxsw_sp; mlxsw_sp 1766 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_span_respin_schedule(mlxsw_sp_port->mlxsw_sp); mlxsw_sp 1802 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1810 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 1848 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 1857 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev); mlxsw_sp 1919 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_span_respin_schedule(mlxsw_sp_port->mlxsw_sp); mlxsw_sp 1924 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static struct mlxsw_sp_port *mlxsw_sp_lag_rep_port(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 1931 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c max_lag_members = MLXSW_CORE_RES_GET(mlxsw_sp->core, mlxsw_sp 1934 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_port = mlxsw_sp_port_lagged_get(mlxsw_sp, lag_id, i); mlxsw_sp 1973 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev); mlxsw_sp 1996 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_8021q_lookup(mlxsw_sp, vid); mlxsw_sp 2006 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_nve_fid_enable(mlxsw_sp, fid, ¶ms, extack); mlxsw_sp 2050 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev); mlxsw_sp 2055 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_8021q_get(mlxsw_sp, vid); mlxsw_sp 2089 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev); mlxsw_sp 2091 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_sp_fid_8021q_lookup(mlxsw_sp, vid); mlxsw_sp 2177 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev); mlxsw_sp 2187 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_8021d_lookup(mlxsw_sp, bridge_device->dev->ifindex); mlxsw_sp 2199 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_nve_fid_enable(mlxsw_sp, fid, ¶ms, extack); mlxsw_sp 2220 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev); mlxsw_sp 2225 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_8021d_get(mlxsw_sp, bridge_device->dev->ifindex); mlxsw_sp 2255 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev); mlxsw_sp 2261 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_sp_fid_8021d_lookup(mlxsw_sp, bridge_device->dev->ifindex); mlxsw_sp 2285 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 2290 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_port = mlxsw_sp_bridge_port_get(mlxsw_sp->bridge, brport_dev); mlxsw_sp 2303 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_put(mlxsw_sp->bridge, bridge_port); mlxsw_sp 2311 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; mlxsw_sp 2315 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 2324 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_port_put(mlxsw_sp->bridge, bridge_port); mlxsw_sp 2327 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2334 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 2342 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c void mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2349 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_lookup_by_vni(mlxsw_sp, vxlan->cfg.vni); mlxsw_sp 2353 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_nve_fid_disable(mlxsw_sp, fid); mlxsw_sp 2357 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp_fid *mlxsw_sp_bridge_fid_get(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2364 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 2449 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_fdb_notify_mac_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2465 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 2467 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Incorrect local port in FDB notification\n"); mlxsw_sp 2471 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (mlxsw_sp_fid_is_dummy(mlxsw_sp, fid)) mlxsw_sp 2490 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, mlxsw_sp 2493 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to set FDB entry\n"); mlxsw_sp 2510 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2527 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_port = mlxsw_sp_lag_rep_port(mlxsw_sp, lag_id); mlxsw_sp 2529 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Cannot find port representor for LAG\n"); mlxsw_sp 2533 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (mlxsw_sp_fid_is_dummy(mlxsw_sp, fid)) mlxsw_sp 2554 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_fdb_uc_lag_op(mlxsw_sp, lag_id, mac, fid, lag_vid, mlxsw_sp 2557 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to set FDB entry\n"); mlxsw_sp 2575 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c __mlxsw_sp_fdb_notify_mac_uc_tunnel_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2616 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 2625 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_fdb_notify_mac_uc_tunnel_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2644 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_lookup_by_index(mlxsw_sp, fid_index); mlxsw_sp 2648 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_nve_learned_ip_resolve(mlxsw_sp, uip, mlxsw_sp 2654 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = __mlxsw_sp_fdb_notify_mac_uc_tunnel_process(mlxsw_sp, fid, adding, mlxsw_sp 2659 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp, mac, fid_index, mlxsw_sp 2685 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp, mac, fid_index, mlxsw_sp 2690 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_fdb_notify_rec_process(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2695 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_mac_process(mlxsw_sp, sfn_pl, mlxsw_sp 2699 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_mac_process(mlxsw_sp, sfn_pl, mlxsw_sp 2703 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_mac_lag_process(mlxsw_sp, sfn_pl, mlxsw_sp 2707 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_mac_lag_process(mlxsw_sp, sfn_pl, mlxsw_sp 2711 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_mac_uc_tunnel_process(mlxsw_sp, sfn_pl, mlxsw_sp 2715 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_mac_uc_tunnel_process(mlxsw_sp, sfn_pl, mlxsw_sp 2721 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_fdb_notify_work_schedule(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 2723 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp_bridge *bridge = mlxsw_sp->bridge; mlxsw_sp 2732 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 2743 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp = bridge->mlxsw_sp; mlxsw_sp 2747 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(sfn), sfn_pl); mlxsw_sp 2749 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to get FDB notifications\n"); mlxsw_sp 2754 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_rec_process(mlxsw_sp, sfn_pl, i); mlxsw_sp 2759 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_work_schedule(mlxsw_sp); mlxsw_sp 2773 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_bridge_vxlan_fdb_event(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2795 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp, mlxsw_sp 2809 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp, mlxsw_sp 2828 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 2848 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp = mlxsw_sp_lower_get(br_dev); mlxsw_sp 2849 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (!mlxsw_sp) mlxsw_sp 2851 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 2864 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_bridge_vxlan_fdb_event(mlxsw_sp, switchdev_work, fid, mlxsw_sp 2914 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_span_respin(mlxsw_sp_port->mlxsw_sp); mlxsw_sp 2924 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_vxlan_fdb_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 2942 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 2946 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_lookup_by_vni(mlxsw_sp, vxlan_fdb_info->vni); mlxsw_sp 2954 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_nve_flood_ip_add(mlxsw_sp, fid, proto, &addr); mlxsw_sp 2975 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp, vxlan_fdb_info->eth_addr, mlxsw_sp 2996 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_vxlan_fdb_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3012 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 3016 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_lookup_by_vni(mlxsw_sp, vxlan_fdb_info->vni); mlxsw_sp 3024 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_nve_flood_ip_del(mlxsw_sp, fid, proto, &addr); mlxsw_sp 3029 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_port_fdb_tunnel_uc_op(mlxsw_sp, vxlan_fdb_info->eth_addr, mlxsw_sp 3044 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 3056 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp = mlxsw_sp_lower_get(br_dev); mlxsw_sp 3057 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (!mlxsw_sp) mlxsw_sp 3062 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_vxlan_fdb_add(mlxsw_sp, switchdev_work); mlxsw_sp 3065 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_vxlan_fdb_del(mlxsw_sp, switchdev_work); mlxsw_sp 3204 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3234 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_lookup_by_vni(mlxsw_sp, vni); mlxsw_sp 3253 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_vxlan_leave(mlxsw_sp, vxlan_dev); mlxsw_sp 3269 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_vxlan_leave(mlxsw_sp, vxlan_dev); mlxsw_sp 3292 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_vxlan_vlan_del(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 3303 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c fid = mlxsw_sp_fid_lookup_by_vni(mlxsw_sp, vni); mlxsw_sp 3311 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_bridge_vxlan_leave(mlxsw_sp, vxlan_dev); mlxsw_sp 3329 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 3338 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp = mlxsw_sp_lower_get(br_dev); mlxsw_sp 3339 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (!mlxsw_sp) mlxsw_sp 3347 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 3357 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_switchdev_vxlan_vlan_add(mlxsw_sp, bridge_device, mlxsw_sp 3376 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 3384 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp = mlxsw_sp_lower_get(br_dev); mlxsw_sp 3385 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c if (!mlxsw_sp) mlxsw_sp 3390 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); mlxsw_sp 3398 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_switchdev_vxlan_vlan_del(mlxsw_sp, bridge_device, mlxsw_sp 3478 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static int mlxsw_sp_fdb_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3480 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c struct mlxsw_sp_bridge *bridge = mlxsw_sp->bridge; mlxsw_sp 3484 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c err = mlxsw_sp_ageing_set(mlxsw_sp, MLXSW_SP_DEFAULT_AGEING_TIME); mlxsw_sp 3486 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err(mlxsw_sp->bus_info->dev, "Failed to set default ageing time\n"); mlxsw_sp 3492 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err(mlxsw_sp->bus_info->dev, "Failed to register switchdev notifier\n"); mlxsw_sp 3499 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c dev_err(mlxsw_sp->bus_info->dev, "Failed to register switchdev blocking notifier\n"); mlxsw_sp 3505 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_notify_work_schedule(mlxsw_sp); mlxsw_sp 3513 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c static void mlxsw_sp_fdb_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3517 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c cancel_delayed_work_sync(&mlxsw_sp->bridge->fdb_notify.dw); mlxsw_sp 3525 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3529 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge = kzalloc(sizeof(*mlxsw_sp->bridge), GFP_KERNEL); mlxsw_sp 3532 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp->bridge = bridge; mlxsw_sp 3533 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c bridge->mlxsw_sp = mlxsw_sp; mlxsw_sp 3535 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c INIT_LIST_HEAD(&mlxsw_sp->bridge->bridges_list); mlxsw_sp 3540 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c return mlxsw_sp_fdb_init(mlxsw_sp); mlxsw_sp 3543 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 3545 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c mlxsw_sp_fdb_fini(mlxsw_sp); mlxsw_sp 3546 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c WARN_ON(!list_empty(&mlxsw_sp->bridge->bridges_list)); mlxsw_sp 3547 drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c kfree(mlxsw_sp->bridge); mlxsw_sp 59 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c static int mlxsw_sp_rx_listener(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, mlxsw_sp 66 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c dev_warn_ratelimited(mlxsw_sp->bus_info->dev, "Port %d: skb received for non-existent port\n", mlxsw_sp 90 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c struct mlxsw_sp *mlxsw_sp; mlxsw_sp 93 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c mlxsw_sp = devlink_trap_ctx_priv(trap_ctx); mlxsw_sp 94 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c mlxsw_sp_port = mlxsw_sp->ports[local_port]; mlxsw_sp 96 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c if (mlxsw_sp_rx_listener(mlxsw_sp, skb, local_port, mlxsw_sp_port)) mlxsw_sp 99 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 100 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c in_devlink_port = mlxsw_core_port_devlink_port_get(mlxsw_sp->core, mlxsw_sp 107 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c int mlxsw_sp_devlink_traps_init(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 109 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 117 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c mlxsw_sp); mlxsw_sp 120 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c void mlxsw_sp_devlink_traps_fini(struct mlxsw_sp *mlxsw_sp) mlxsw_sp 122 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp 203 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c mlxsw_sp_trap_group_policer_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 227 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qpcr), qpcr_pl); mlxsw_sp 231 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c __mlxsw_sp_trap_group_init(struct mlxsw_sp *mlxsw_sp, mlxsw_sp 250 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(htgt), htgt_pl); mlxsw_sp 256 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); mlxsw_sp 259 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c err = mlxsw_sp_trap_group_policer_init(mlxsw_sp, group); mlxsw_sp 263 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c err = __mlxsw_sp_trap_group_init(mlxsw_sp, group); mlxsw_sp 12 include/trace/events/mlxsw.h struct mlxsw_sp; mlxsw_sp 17 include/trace/events/mlxsw.h TP_PROTO(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 20 include/trace/events/mlxsw.h TP_ARGS(mlxsw_sp, aregion), mlxsw_sp 23 include/trace/events/mlxsw.h __field(const void *, mlxsw_sp) mlxsw_sp 28 include/trace/events/mlxsw.h __entry->mlxsw_sp = mlxsw_sp; mlxsw_sp 33 include/trace/events/mlxsw.h __entry->mlxsw_sp, __entry->aregion) mlxsw_sp 37 include/trace/events/mlxsw.h TP_PROTO(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 40 include/trace/events/mlxsw.h TP_ARGS(mlxsw_sp, vregion), mlxsw_sp 43 include/trace/events/mlxsw.h __field(const void *, mlxsw_sp) mlxsw_sp 48 include/trace/events/mlxsw.h __entry->mlxsw_sp = mlxsw_sp; mlxsw_sp 53 include/trace/events/mlxsw.h __entry->mlxsw_sp, __entry->vregion) mlxsw_sp 57 include/trace/events/mlxsw.h TP_PROTO(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 60 include/trace/events/mlxsw.h TP_ARGS(mlxsw_sp, vregion), mlxsw_sp 63 include/trace/events/mlxsw.h __field(const void *, mlxsw_sp) mlxsw_sp 68 include/trace/events/mlxsw.h __entry->mlxsw_sp = mlxsw_sp; mlxsw_sp 73 include/trace/events/mlxsw.h __entry->mlxsw_sp, __entry->vregion) mlxsw_sp 77 include/trace/events/mlxsw.h TP_PROTO(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 80 include/trace/events/mlxsw.h TP_ARGS(mlxsw_sp, vregion), mlxsw_sp 83 include/trace/events/mlxsw.h __field(const void *, mlxsw_sp) mlxsw_sp 88 include/trace/events/mlxsw.h __entry->mlxsw_sp = mlxsw_sp; mlxsw_sp 93 include/trace/events/mlxsw.h __entry->mlxsw_sp, __entry->vregion) mlxsw_sp 97 include/trace/events/mlxsw.h TP_PROTO(const struct mlxsw_sp *mlxsw_sp, mlxsw_sp 100 include/trace/events/mlxsw.h TP_ARGS(mlxsw_sp, vregion), mlxsw_sp 103 include/trace/events/mlxsw.h __field(const void *, mlxsw_sp) mlxsw_sp 108 include/trace/events/mlxsw.h __entry->mlxsw_sp = mlxsw_sp; mlxsw_sp 113 include/trace/events/mlxsw.h __entry->mlxsw_sp, __entry->vregion)