summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Britstein <elibr@mellanox.com>2019-06-02 06:19:03 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-28 08:28:35 +0200
commit8c1dd131d9f818672d74e8a532e2fc5b01013b9a (patch)
treec5fa9c4146955da68c5d5f8f0059d57da5dc7479
parent06ff90ba3c8c4ddd4d411ce5bea3a0fe3a34e0a3 (diff)
downloadlinux-stable-8c1dd131d9f818672d74e8a532e2fc5b01013b9a.tar.gz
linux-stable-8c1dd131d9f818672d74e8a532e2fc5b01013b9a.tar.bz2
linux-stable-8c1dd131d9f818672d74e8a532e2fc5b01013b9a.zip
net/mlx5e: Fix port tunnel GRE entropy control
[ Upstream commit 914adbb1bcf89478ac138318d28b302704564d59 ] GRE entropy calculation is a single bit per card, and not per port. Force disable GRE entropy calculation upon the first GRE encap rule, and release the force at the last GRE encap rule removal. This is done per port. Fixes: 97417f6182f8 ("net/mlx5e: Fix GRE key by controlling port tunnel entropy calculation") Signed-off-by: Eli Britstein <elibr@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
index 40f4a19b1ce1..5e2cea26f335 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c
@@ -100,27 +100,12 @@ static int mlx5_set_entropy(struct mlx5_tun_entropy *tun_entropy,
*/
if (entropy_flags.gre_calc_supported &&
reformat_type == MLX5_REFORMAT_TYPE_L2_TO_NVGRE) {
- /* Other applications may change the global FW entropy
- * calculations settings. Check that the current entropy value
- * is the negative of the updated value.
- */
- if (entropy_flags.force_enabled &&
- enable == entropy_flags.gre_calc_enabled) {
- mlx5_core_warn(tun_entropy->mdev,
- "Unexpected GRE entropy calc setting - expected %d",
- !entropy_flags.gre_calc_enabled);
- return -EOPNOTSUPP;
- }
- err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, enable,
- entropy_flags.force_supported);
+ if (!entropy_flags.force_supported)
+ return 0;
+ err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev,
+ enable, !enable);
if (err)
return err;
- /* if we turn on the entropy we don't need to force it anymore */
- if (entropy_flags.force_supported && enable) {
- err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, 1, 0);
- if (err)
- return err;
- }
} else if (entropy_flags.calc_supported) {
/* Other applications may change the global FW entropy
* calculations settings. Check that the current entropy value