Blob Blame History Raw
From d0b7b0101b6234149651940453cb568c716f9e3c Mon Sep 17 00:00:00 2001
From: Alaa Hleihel <ahleihel@redhat.com>
Date: Tue, 12 May 2020 10:54:59 -0400
Subject: [PATCH 187/312] [netdrv] net/mlx5: Fix group version management

Message-id: <20200512105530.4207-94-ahleihel@redhat.com>
Patchwork-id: 306966
Patchwork-instance: patchwork
O-Subject: [RHEL8.3 BZ 1789382 093/124] net/mlx5: Fix group version management
Bugzilla: 1789382
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
RH-Acked-by: Kamal Heib <kheib@redhat.com>
RH-Acked-by: Jarod Wilson <jarod@redhat.com>

Bugzilla: http://bugzilla.redhat.com/1789382
Upstream: v5.7-rc1

commit 454401aeb2957e0d996bc9208b78aa4d8ac12964
Author: Eli Cohen <eli@mellanox.com>
Date:   Wed Mar 4 10:32:56 2020 +0200

    net/mlx5: Fix group version management

    When adding a rule to a flow group we need increment the version of the
    group. Current code fails to do that and as a result, when trying to add
    a rule, we will fail to discover a case where an FTE with the same match
    value was added while we scanned the groups of the same match criteria,
    thus we may try to add an FTE that was already added.

    Signed-off-by: Eli Cohen <eli@mellanox.com>
    Reviewed-by: Mark Bloch <markb@mellanox.com>
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>

Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 4c7c707f9e2d..7cc21f08cbcc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1342,6 +1342,7 @@ add_rule_fte(struct fs_fte *fte,
 	fte->node.active = true;
 	fte->status |= FS_FTE_STATUS_EXISTING;
 	atomic_inc(&fte->node.version);
+	atomic_inc(&fg->node.version);
 
 out:
 	return handle;
-- 
2.13.6