* [patch net 0/2] mlxsw: couple of fixes
@ 2016-09-08 6:16 Jiri Pirko
2016-09-08 6:16 ` [patch net 1/2] mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jiri Pirko @ 2016-09-08 6:16 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, ogerlitz
From: Jiri Pirko <jiri@mellanox.com>
Couple of fixes from Ido and myself.
Ido Schimmel (1):
mlxsw: spectrum: Set port type before setting its address
Jiri Pirko (1):
mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 +++++++++---------
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 9 ++++++++-
2 files changed, 17 insertions(+), 10 deletions(-)
--
2.5.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch net 1/2] mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init
2016-09-08 6:16 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
@ 2016-09-08 6:16 ` Jiri Pirko
2016-09-08 6:38 ` Ido Schimmel
2016-09-08 6:16 ` [patch net 2/2] mlxsw: spectrum: Set port type before setting its address Jiri Pirko
2016-09-09 23:57 ` [patch net 0/2] mlxsw: couple of fixes David Miller
2 siblings, 1 reply; 5+ messages in thread
From: Jiri Pirko @ 2016-09-08 6:16 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, ogerlitz
From: Jiri Pirko <jiri@mellanox.com>
When neigh_init fails, we have to do proper cleanup including
router_fini call.
Fixes: 6cf3c971dc84cb ("mlxsw: spectrum_router: Add private neigh table")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 352259b..3f5c51d 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)
return err;
mlxsw_sp_lpm_init(mlxsw_sp);
mlxsw_sp_vrs_init(mlxsw_sp);
- return mlxsw_sp_neigh_init(mlxsw_sp);
+ err = mlxsw_sp_neigh_init(mlxsw_sp);
+ if (err)
+ goto err_neigh_init;
+ return 0;
+
+err_neigh_init:
+ __mlxsw_sp_router_fini(mlxsw_sp);
+ return err;
}
void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp)
--
2.5.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [patch net 2/2] mlxsw: spectrum: Set port type before setting its address
2016-09-08 6:16 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2016-09-08 6:16 ` [patch net 1/2] mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init Jiri Pirko
@ 2016-09-08 6:16 ` Jiri Pirko
2016-09-09 23:57 ` [patch net 0/2] mlxsw: couple of fixes David Miller
2 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2016-09-08 6:16 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, ogerlitz
From: Ido Schimmel <idosch@mellanox.com>
During port init, we currently set the port's type to Ethernet after
setting its MAC address. However, the hardware documentation states this
should be the other way around.
Align the driver with the hardware documentation and set the port's MAC
address after setting its type.
Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index e16b347..d48873b 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,
dev->netdev_ops = &mlxsw_sp_port_netdev_ops;
dev->ethtool_ops = &mlxsw_sp_port_ethtool_ops;
+ err = mlxsw_sp_port_swid_set(mlxsw_sp_port, 0);
+ if (err) {
+ dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set SWID\n",
+ mlxsw_sp_port->local_port);
+ goto err_port_swid_set;
+ }
+
err = mlxsw_sp_port_dev_addr_init(mlxsw_sp_port);
if (err) {
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,
goto err_port_system_port_mapping_set;
}
- err = mlxsw_sp_port_swid_set(mlxsw_sp_port, 0);
- if (err) {
- dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to set SWID\n",
- mlxsw_sp_port->local_port);
- goto err_port_swid_set;
- }
-
err = mlxsw_sp_port_speed_by_width_set(mlxsw_sp_port, width);
if (err) {
dev_err(mlxsw_sp->bus_info->dev, "Port %d: Failed to enable speeds\n",
@@ -2219,10 +2219,10 @@ err_port_buffers_init:
err_port_admin_status_set:
err_port_mtu_set:
err_port_speed_by_width_set:
- mlxsw_sp_port_swid_set(mlxsw_sp_port, MLXSW_PORT_SWID_DISABLED_PORT);
-err_port_swid_set:
err_port_system_port_mapping_set:
err_dev_addr_init:
+ mlxsw_sp_port_swid_set(mlxsw_sp_port, MLXSW_PORT_SWID_DISABLED_PORT);
+err_port_swid_set:
free_percpu(mlxsw_sp_port->pcpu_stats);
err_alloc_stats:
kfree(mlxsw_sp_port->untagged_vlans);
--
2.5.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch net 1/2] mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init
2016-09-08 6:16 ` [patch net 1/2] mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init Jiri Pirko
@ 2016-09-08 6:38 ` Ido Schimmel
0 siblings, 0 replies; 5+ messages in thread
From: Ido Schimmel @ 2016-09-08 6:38 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, idosch, eladr, yotamg, nogahf, ogerlitz
On Thu, Sep 08, 2016 at 08:16:01AM +0200, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> When neigh_init fails, we have to do proper cleanup including
> router_fini call.
>
> Fixes: 6cf3c971dc84cb ("mlxsw: spectrum_router: Add private neigh table")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Ido Schimmel <idosch@mellanox.com>
Thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch net 0/2] mlxsw: couple of fixes
2016-09-08 6:16 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2016-09-08 6:16 ` [patch net 1/2] mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init Jiri Pirko
2016-09-08 6:16 ` [patch net 2/2] mlxsw: spectrum: Set port type before setting its address Jiri Pirko
@ 2016-09-09 23:57 ` David Miller
2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-09-09 23:57 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, eladr, yotamg, nogahf, ogerlitz
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 8 Sep 2016 08:16:00 +0200
> Couple of fixes from Ido and myself.
Series applied, thanks Jiri.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-09-09 23:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-08 6:16 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2016-09-08 6:16 ` [patch net 1/2] mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init Jiri Pirko
2016-09-08 6:38 ` Ido Schimmel
2016-09-08 6:16 ` [patch net 2/2] mlxsw: spectrum: Set port type before setting its address Jiri Pirko
2016-09-09 23:57 ` [patch net 0/2] mlxsw: couple of fixes David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).