lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ3xEMjzSHFo8YQZcd-nP0BeMhnSV=1kgtdkk_Wc80Tuk=GnKQ@mail.gmail.com>
Date:	Wed, 2 Dec 2015 07:47:51 +0200
From:	Or Gerlitz <gerlitz.or@...il.com>
To:	Jiri Pirko <jiri@...nulli.us>
Cc:	Linux Netdev List <netdev@...r.kernel.org>,
	David Miller <davem@...emloft.net>,
	Ido Schimmel <idosch@...lanox.com>,
	Elad Raz <eladr@...lanox.com>, yotamg@...lanox.com,
	Or Gerlitz <ogerlitz@...lanox.com>
Subject: Re: [patch net-next 24/26] mlxsw: spectrum: Implement LAG port join/leave

On Tue, Dec 1, 2015 at 3:49 PM, Jiri Pirko <jiri@...nulli.us> wrote:
> Implement basic procedures for joining/leaving port to/from LAG. That
> includes HW setup of collector, core LAG mapping setup.
>
> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 284 +++++++++++++++++++++++--
>  drivers/net/ethernet/mellanox/mlxsw/spectrum.h |  35 ++-
>  2 files changed, 302 insertions(+), 17 deletions(-)
>
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c

[...]

> +static int mlxsw_sp_port_lag_leave(struct mlxsw_sp_port *mlxsw_sp_port,
> +                                  struct net_device *lag_dev)
> +{
> +       struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
> +       struct mlxsw_sp_upper *lag;
> +       u16 lag_id = mlxsw_sp_port->lag_id;
> +       int err;
> +
> +       if (!mlxsw_sp_port->lagged)
> +               return 0;
> +       lag = mlxsw_sp_lag_get(mlxsw_sp, lag_id);
> +       BUG_ON(lag->ref_count == 0);

is this a must to crash the system here? can't we do something less drastic?

> +
> +       err = mlxsw_sp_lag_col_port_disable(mlxsw_sp_port, lag_id);
> +       if (err)
> +               return err;
> +       mlxsw_sp_lag_col_port_remove(mlxsw_sp_port, lag_id);
> +       if (err)
> +               return err;
> +
> +       if (lag->ref_count == 1) {
> +               err = mlxsw_sp_lag_destroy(mlxsw_sp, lag_id);
> +               if (err)
> +                       return err;
> +       }
> +
> +       mlxsw_core_lag_mapping_clear(mlxsw_sp->core, lag_id,
> +                                    mlxsw_sp_port->local_port);
> +       mlxsw_sp_port->lagged = 0;
> +       lag->ref_count--;
> +       return 0;
> +}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ