diff options
author | David S. Miller <davem@davemloft.net> | 2016-09-09 19:56:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-09 19:56:54 -0400 |
commit | 1b672f5fefa80bfcb8d11df1d7ee1cb1bb4f4fb4 (patch) | |
tree | 211182527aa6482c4b186249673851fcff76b936 | |
parent | 2c2c8e33e4aa6e46f19ef7bba8e559759a74a4db (diff) | |
parent | 3247ff2b318f3eeaaf32163ce39ddaac23e9a6f9 (diff) |
Merge branch 'mlxsw-fixes'
Jiri Pirko says:
====================
mlxsw: couple of fixes
Couple of fixes from Ido and myself.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 9 |
2 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index e16b34718c8c..d48873bcbddf 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c | |||
@@ -2106,6 +2106,13 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port, | |||
2106 | dev->netdev_ops = &mlxsw_sp_port_netdev_ops; | 2106 | dev->netdev_ops = &mlxsw_sp_port_netdev_ops; |
2107 | dev->ethtool_ops = &mlxsw_sp_port_ethtool_ops; | 2107 | dev->ethtool_ops = &mlxsw_sp_port_ethtool_ops; |
2108 | 2108 | ||
2109 | err = mlxsw_sp_port_swid_set(mlxsw_sp_port, 0); | ||
2110 | if (err) { | ||
2111 | dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set SWID\n", | ||
2112 | mlxsw_sp_port->local_port); | ||
2113 | goto err_port_swid_set; | ||
2114 | } | ||
2115 | |||
2109 | err = mlxsw_sp_port_dev_addr_init(mlxsw_sp_port); | 2116 | err = mlxsw_sp_port_dev_addr_init(mlxsw_sp_port); |
2110 | if (err) { | 2117 | if (err) { |
2111 | dev_err(mlxsw_sp->bus_info->dev, "Port %d: Unable to init port mac address\n", | 2118 | dev_err(mlxsw_sp->bus_info->dev, "Port %d: Unable to init port mac address\n", |
@@ -2131,13 +2138,6 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port, | |||
2131 | goto err_port_system_port_mapping_set; | 2138 | goto err_port_system_port_mapping_set; |
2132 | } | 2139 | } |
2133 | 2140 | ||
2134 | err = mlxsw_sp_port_swid_set(mlxsw_sp_port, 0); | ||
2135 | if (err) { | ||
2136 | dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set SWID\n", | ||
2137 | mlxsw_sp_port->local_port); | ||
2138 | goto err_port_swid_set; | ||
2139 | } | ||
2140 | |||
2141 | err = mlxsw_sp_port_speed_by_width_set(mlxsw_sp_port, width); | 2141 | err = mlxsw_sp_port_speed_by_width_set(mlxsw_sp_port, width); |
2142 | if (err) { | 2142 | if (err) { |
2143 | dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to enable speeds\n", | 2143 | dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to enable speeds\n", |
@@ -2219,10 +2219,10 @@ err_port_buffers_init: | |||
2219 | err_port_admin_status_set: | 2219 | err_port_admin_status_set: |
2220 | err_port_mtu_set: | 2220 | err_port_mtu_set: |
2221 | err_port_speed_by_width_set: | 2221 | err_port_speed_by_width_set: |
2222 | mlxsw_sp_port_swid_set(mlxsw_sp_port, MLXSW_PORT_SWID_DISABLED_PORT); | ||
2223 | err_port_swid_set: | ||
2224 | err_port_system_port_mapping_set: | 2222 | err_port_system_port_mapping_set: |
2225 | err_dev_addr_init: | 2223 | err_dev_addr_init: |
2224 | mlxsw_sp_port_swid_set(mlxsw_sp_port, MLXSW_PORT_SWID_DISABLED_PORT); | ||
2225 | err_port_swid_set: | ||
2226 | free_percpu(mlxsw_sp_port->pcpu_stats); | 2226 | free_percpu(mlxsw_sp_port->pcpu_stats); |
2227 | err_alloc_stats: | 2227 | err_alloc_stats: |
2228 | kfree(mlxsw_sp_port->untagged_vlans); | 2228 | kfree(mlxsw_sp_port->untagged_vlans); |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 352259b3c38a..3f5c51da6d3e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | |||
@@ -1517,7 +1517,14 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp) | |||
1517 | return err; | 1517 | return err; |
1518 | mlxsw_sp_lpm_init(mlxsw_sp); | 1518 | mlxsw_sp_lpm_init(mlxsw_sp); |
1519 | mlxsw_sp_vrs_init(mlxsw_sp); | 1519 | mlxsw_sp_vrs_init(mlxsw_sp); |
1520 | return mlxsw_sp_neigh_init(mlxsw_sp); | 1520 | err = mlxsw_sp_neigh_init(mlxsw_sp); |
1521 | if (err) | ||
1522 | goto err_neigh_init; | ||
1523 | return 0; | ||
1524 | |||
1525 | err_neigh_init: | ||
1526 | __mlxsw_sp_router_fini(mlxsw_sp); | ||
1527 | return err; | ||
1521 | } | 1528 | } |
1522 | 1529 | ||
1523 | void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) | 1530 | void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) |