Patch "net/mlx5e: Register/unregister vport representors on interface attach/detach" has been added to the 4.10-stable tree
This is a note to let you know that I've just added the patch titled
net/mlx5e: Register/unregister vport representors on interface attach/detach
to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-mlx5e-register-unregister-vport-representors-on-interface-attach-detach.patch
and it can be found in the queue-4.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Sat Mar 18 22:03:53 CST 2017
From: Saeed Mahameed <[email protected]>
Date: Wed, 22 Feb 2017 17:20:12 +0200
Subject: net/mlx5e: Register/unregister vport representors on interface attach/detach
From: Saeed Mahameed <[email protected]>
[ Upstream commit 6f08a22c5fb2b9aefb8ecd8496758e7a677c1fde ]
Currently vport representors are added only on driver load and removed on driver unload. Apparently we forgot to handle them when we added the seamless reset flow feature. This caused to leave the representors netdevs alive and active with open HW resources on pci shutdown and on error reset flows.
To overcome this we move their handling to interface attach/detach, so they would be cleaned up on shutdown and recreated on reset flows.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +15 -8
@@ -3940,6 +3940,19 @@ static void mlx5e_register_vport_rep(str } } +static void mlx5e_unregister_vport_rep (struct mlx5_core_dev *mdev) +{ +struct mlx5_eswitch *esw = mdev->priv.eswitch; +int total_vfs =MLX5_TOTAL_VPORTS (mdev); +int vport; + +if (!MLX5_CAP_GEN (mdev, vport_group_manager)) +return ; + +for (vport =1 ; vport < total_vfs; vport++) +mlx5_eswitch_unregister_vport_rep (esw, vport); +} +void mlx5e_detach_netdev (struct mlx5_core_dev *mdev,struct net_device *netdev) {struct mlx5e_priv *priv =netdev_priv (netdev);
@@ -3986,6 +3999,7 @@ static int mlx5e_attach(struct mlx5_corereturn err; } +mlx5e_register_vport_rep (mdev);return 0 ; }
@@ -3997,6 +4011,7 @@ static void mlx5e_detach(struct mlx5_corif (!netif_device_present (netdev))return ; +mlx5e_unregister_vport_rep (mdev);mlx5e_detach_netdev (mdev, netdev);mlx5e_destroy_mdev_resources (mdev); }
@@ -4015,8 +4030,6 @@ static void *mlx5e_add(struct mlx5_core_if (err)return NULL ; -mlx5e_register_vport_rep (mdev); -if (MLX5_CAP_GEN (mdev, vport_group_manager)) ppriv = &esw->offloads.vport_reps[0 ];
@@ -4068,13 +4081,7 @@ void mlx5e_destroy_netdev(struct mlx5_costatic void mlx5e_remove (struct mlx5_core_dev *mdev,void *vpriv) { -struct mlx5_eswitch *esw = mdev->priv.eswitch; -int total_vfs =MLX5_TOTAL_VPORTS (mdev);struct mlx5e_priv *priv = vpriv; -int vport; - -for (vport =1 ; vport < total_vfs; vport++) -mlx5_eswitch_unregister_vport_rep (esw, vport);unregister_netdev (priv->netdev);mlx5e_detach (mdev, vpriv);
Patches currently in stable-queue which might be from [email protected] are
queue-4.10/net-mlx5e-fix-broken-cqe-compression-initialization.patch queue-4.10/net-mlx5e-update-mpwqe-stride-size-when-modifying-cqe-compress-state.patch queue-4.10/net-mlx5e-do-not-reduce-lro-wqe-size-when-not-using-build_skb.patch queue-4.10/net-mlx5e-fix-wrong-cqe-decompression.patch queue-4.10/net-mlx5e-register-unregister-vport-representors-on-interface-attach-detach.patch