net/mlx5e: Introduce switch channels
authorSaeed Mahameed <saeedm@mellanox.com>
Tue, 27 Dec 2016 12:57:03 +0000 (14:57 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 27 Mar 2017 12:08:20 +0000 (15:08 +0300)
commit55c2503dae1ac8aed14d261dc02f967b4d6b1f88
tree24fe95aadcc5f7166b9a25b6058e5a4356527ddd
parent9008ae074885ddaa2470f4c106245ddea4ae2a67
net/mlx5e: Introduce switch channels

A fail safe helper functions that allows switching to new channels on the
fly,  In simple words:

make_new_config(new_params)
{
    new_channels = open_channels(new_params);
    if (!new_channels)
         return "Failed, but current channels are still active :)"

    switch_channels(new_channels);

    return "SUCCESS";
}

Demonstrate mlx5e_switch_priv_channels usage in set channels ethtool
callback and make it fail-safe using the new switch channels mechanism.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c